三亿数据的表,四个索引。现在插入数据的时候,已经会出现插入缓慢的问题,有没有什么解决办法
|
ThisDayAug 27, 2015
1
把索引删了,手工建立另外的索引表
|
|
realpgAug 27, 2015
2
三亿还不分表……
|
|
jnduanAug 27, 2015
3
mysql> SHOW GLOBAL VARIABLES LIKE 'innodb_flush_log%';
+--------------------------------+-------+ | Variable_name | Value | +--------------------------------+-------+ | innodb_flush_log_at_trx_commit | 1 | +--------------------------------+-------+ 1 row in set (0.00 sec ) 查看 innodb_flush_log_at_trx_commit 参数为 1 , 临时修改为 2 : set global innodb_flush_log_at_trx_commit=2; 插入性能得到明显提升。 为确保数据完整,可以在导入完成后将上述参数改回 1 。 |
|
zsmjcnmAug 27, 2015
4
你的 INSERT 语句是什么?你的表结构是什么?你的机器配置是什么?
|
|
mahone3297Aug 27, 2015
5
可能需要分表。
|
|
inviteAug 28, 2015
6
索引多大?
|