The fastest way to use MyISAM tables when storing indexes), and possibly other storage mechanisms:
CREATE TABLE copy LIKE original; ALTER TABLE copy DISABLE KEYS; INSERT INTO copy SELECT * FROM original; ALTER TABLE copy ENABLE KEYS;
You want to disconnect your keys to load the database, and then recreate the keys at the end.
Similarly, for InnoDB :
SET unique_checks=0; SET foreign_key_checks=0; ..insert sql code here.. SET unique_checks=1; SET foreign_key_checks=1;
(As stated in the comments.)
ctbrown Mar 17 '14 at 23:09 2014-03-17 23:09
source share