三亿数据的表,四个索引。现在插入数据的时候,已经会出现插入缓慢的问题,有没有什么解决办法

1 ThisDay Aug 27, 2015 把索引删了,手工建立另外的索引表 |
2 realpg PRO 三亿还不分表…… |
3 jnduan Aug 27, 2015 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 。 |
4 zsmjcnm Aug 27, 2015 你的 INSERT 语句是什么?你的表结构是什么?你的机器配置是什么? |
5 mahone3297 Aug 27, 2015 可能需要分表。 |
6 invite Aug 28, 2015 索引多大? |