0

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.

shantanuo
  • 31,689
  • 78
  • 245
  • 403

2 Answers2

2

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.

Brent Baisley
  • 12,641
  • 2
  • 26
  • 39
0

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.

tmcallaghan
  • 1,292
  • 2
  • 10
  • 20