myql 配置项
提高数据插入速度方法
bulk_insert_buffer_size
默认:8M (8*1024*1024)
参考网址:https://stackoverflow.com/questions/20301010/how-to-set-bulk-insert-buffer-size-in-mysql
mysql> show variables like '%bulk%'; +-------------------------+-----------+ | Variable_name | Value | +-------------------------+-----------+ | bulk_insert_buffer_size | 268435456 | <= initial value +-------------------------+-----------+ 1 row in set (0.00 sec) mysql> set global bulk_insert_buffer_size = 1024 * 1024 * 1; Query OK, 0 rows affected (0.00 sec) mysql> show variables like '%bulk%'; +-------------------------+-----------+ | Variable_name | Value | +-------------------------+-----------+ | bulk_insert_buffer_size | 268435456 | <= not changed with GLOBAL +-------------------------+-----------+ 1 row in set (0.00 sec) mysql> set session bulk_insert_buffer_size = 1024 * 1024 * 1; Query OK, 0 rows affected (0.00 sec) mysql> show variables like '%bulk%'; +-------------------------+---------+ | Variable_name | Value | +-------------------------+---------+ | bulk_insert_buffer_size | 1048576 | <= changed with SESSION +-------------------------+---------+ 1 row in set (0.00 sec)