• MySQL Fast Bulk Inserts

    Posted on June 15th, 2010 admin No comments

    This post will be very short, i just will share a command to enable MySQL to make fast bulk inserts on MyISAM tables.

    In some tables that you need to insert a lot of data, exists a right technique to do that.

    –  Befor starting the inserts go to mysql > alter table target_table disable keys;

    This command above will disable all indexs updates during the inserts, that speeds up the insert operation, after you end inserting all data you need to recreate does indexes typing the following command mysql > alter table target_table enable keys;

    Easy? Yeah. This command had helped me a lot, as i manipulate a lot of data, millions and millions of rows this is very useful and the gains are in hours, now i have more time to see Brazil playing on the World Cup. :)