- 论坛徽章:
- 0
|
我用concat 来实现向longblob中追加数据, 但是随着追加的数据越来越多, 性能就越来越差,
由于concat每次要返回 追加的数据, 并且返回的数据大小受max_allowed_packet 大小限制,
请教有没有向longblob字段中其他追加数据的方法,数据大小在1G以上。
以下我用concat测试,每次向wbackup_allsession表中的wmeta追加10M数据,当追加到60M的时候延时为24秒了
性能越来越差。
mysql> update wbackup_allsession set wmeta = concat( wmeta, repeat( 'x', 1024*1024*10 ) ) where
sesid = 'a';
Query OK, 1 row affected (0.81 sec)
Rows matched: 1 Changed: 1 Warnings: 0
mysql> update wbackup_allsession set wmeta = concat( wmeta, repeat( 'x', 1024*1024*10 ) ) where
sesid = 'a';
Query OK, 1 row affected (1.55 sec)
Rows matched: 1 Changed: 1 Warnings: 0
mysql> update wbackup_allsession set wmeta = concat( wmeta, repeat( 'x', 1024*1024*10 ) ) where
sesid = 'a';
Query OK, 1 row affected (2.41 sec)
Rows matched: 1 Changed: 1 Warnings: 0
mysql> update wbackup_allsession set wmeta = concat( wmeta, repeat( 'x', 1024*1024*10 ) ) where
sesid = 'a';
Query OK, 1 row affected (5.08 sec)
Rows matched: 1 Changed: 1 Warnings: 0
mysql> update wbackup_allsession set wmeta = concat( wmeta, repeat( 'x', 1024*1024*10 ) ) where
sesid = 'a';
Query OK, 1 row affected (21.78 sec)
Rows matched: 1 Changed: 1 Warnings: 0
mysql> update wbackup_allsession set wmeta = concat( wmeta, repeat( 'x', 1024*1024*10 ) ) where
sesid = 'a';
Query OK, 1 row affected (24.92 sec)
Rows matched: 1 Changed: 1 Warnings: 0
[ 本帖最后由 bingobingo 于 2007-12-9 22:50 编辑 ] |
|