Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I read the following on this page

bulk_insert_buffer_size MyISAM uses a special tree-like cache to make bulk inserts faster for INSERT ... SELECT, INSERT ... VALUES (...), (...), ..., and LOAD DATA INFILE. This variable limits the size of the cache tree in bytes per thread. Setting it to 0 disables this optimization. Note: This cache is used only when adding data to a non-empty table. The default value is 8MB. This variable was added in MySQL 4.0.3. This variable previously was named myisam_bulk_insert_tree_size.

I take this to mean that bulk_insert_buffer_size has no bearing on InnoDB tables, only on MyISAM tables. Is this correct?

share|improve this question

Yes, you are correct. I wrote about this before: How can I optimize this mySQL table that will need to hold 5+ million rows?

WHen it comes to bulk loading InnoDB tables, one of the most frequently ignored settings to disable is innodb_doublewrite.

InnoDB Architecture

InnoDB Architecture

Please note the double write buffer inside the system tablespace file ibdata1. Every time a 16K page is written to an InnoDB table or transaction log, the page is written to the double wrote buffer first. All you need to do is disable it, load your data, and reenable it.

STEP 01 : Disable Fast Shutdown

mysql -uroot -p... -ANe"SET GLOBAL innodb_fast_shutdown = 0"

STEP 02 : Restart mysql without the double write buffer

service mysql restart --innodb-doublewrite=0

STEP 03 : Load the InnoDB data

STEP 04 : Restart mysql

service mysql restart


You can disable the foreign key checks and the unique checks as well. Any standard mysqldump will do that for you already.

share|improve this answer
unless it is (properly configured) zfs, disabling doublewrite may cause page corruptions (when partial write happens). – noonex Mar 1 at 9:20

Yes it only works with MyISAM tables.

For Innodb we need to diable unique_checks and foreign_key_checks using

set unique_checks=0; set foreign_key_checks=0; diable auto_commit.


set unique_checks=1; set foreign_key_checks=1; enable auto_commit.

Which improves bulk inserts performance.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.