Created
May 8, 2011 14:59
-
-
Save sobstel/961414 to your computer and use it in GitHub Desktop.
MySQL fast data load
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#1 | |
LOAD DATA INFILE... | |
#2 | |
ALTER TABLE name DISABLE KEYS; // tells MySQL to stop updating nonunique indexes | |
INSERT ... | |
... | |
ALTER TABLE name ENABLE KEYS; // re-creates missing indexes (much faster than inserting one by one) | |
#3 (InnoDB) | |
BEGIN; | |
INSERT ... | |
... | |
COMMIT; | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment