MyISAM uses a special tree-like cache to make bulk inserts faster for INSERT ... SELECT, INSERT ... VALUES (...), (...), ..., and LOAD DATA INFILE when adding data to nonempty tables. The BULK_INSERT_BUFFER_SIZE variable limits the size of the cache tree in bytes per thread. Setting it to 0 disables this optimization. The default value is 8MB. The maximum value is 4GB. The bulk_insert_buffer_size can be set both on system and session levels.
If data is being added to a non-empty table, tuning the bulk_insert_buffer_size variable can make data insertion faster. Normaily, it shows the improvement when the data to be inserted is more than 10k rows. But it is hard to say what is the right value, so, trail and try with incremental buffer size values.
Also, performance improvement will be more obvisoue if the following variables are also set:
- MYISAM_SORT_BUFFER_SIZE
- KEY_BUFFER_SIZE
alter table t disable keys;
References:
Related Posts:
- MySQL MYISAM_SORT_BUFFER_SIZE Variable
- MySQL KEY_BUFFER_SIZE variable
- MySQL Alter Table t Disable Keys Statement
- MySQL Optimize Table Command
No comments:
Post a Comment