Question

Is there any mysql parameter to improve the speed of "LOAD DATA INFILE " ?

I am using 1 MyISAM and 1 TokuDB table. The data is saved as Tab separated text file.

Was it helpful?

Solution

There are a number of ways to speed this up. http://dev.mysql.com/doc/refman/5.1/en/insert-speed.html

For large inserts it's usually the index updating that slows things down. So even using techniques like locking the table, turning off index updates, it can still take a long time when the indexes have to be created. Index creation, and thus inserts, on MyISAM tables can be sped up by increasing the value of the key_buffer_size. Make this large enough to hold the index(es) and your inserts can speed up by orders of magnitude. You can reduce it after the insert if need be.

OTHER TIPS

Are you loading into an empty table or a table with rows already in it? If the table is empty, TokuDB will implement it's bulk loader and load the data very quickly.

Also, if you are loading data into a table with unique indexes (PK or secondary), turn off unique_checks if you know the data is unique.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top