MySQL Variables bulk_insert_buffer_size 数据库 参数变量解释及正确配置使用
本站中文解释
bulk_insert_buffer_size变量用于指定MySQL每次插入大量数据时,MySQL内部缓存内存空间的大小。当MySQL用于插入大量的内容时,设置较大的bulk_insert_buffer_size可以在保证性能的基础上提升批量插入的速度,因为MySQL可以一次性将数据放入缓冲中而不必每条记录都单独提交到磁盘上。
要设置bulk_insert_buffer_size,可以在MySQL的参数缓存中直接设置其值:
mysql> SET GLOBAL bulk_insert_buffer_size = 8388608;
官方英文解释
bulk_insert_buffer_size
| Command-Line Format | --bulk-insert-buffer-size=# |
|---|---|
| System Variable | bulk_insert_buffer_size |
| Scope | Global, Session |
| Dynamic | Yes |
| Type | Integer |
| Default Value | 8388608 |
| Minimum Value | 0 |
| Maximum Value (64-bit platforms) | 18446744073709551615 |
| Maximum Value (32-bit platforms) | 4294967295 |
| Unit | bytes/thread |
MyISAM uses a special tree-like cache to
make bulk inserts faster for
INSERT ...,
SELECTINSERT ... VALUES (...), (...),, and
...LOAD DATA
when adding data to nonempty tables. This variable limits the
size of the cache tree in bytes per thread. Setting it to 0
disables this optimization. The default value is 8MB.