Created
October 15, 2015 04:44
-
-
Save islander/b9047ef045eb88ecea92 to your computer and use it in GitHub Desktop.
MySQL fast drop big table
This file contains hidden or 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
| CREATE TABLE new_foo LIKE foo; | |
| ALTER TABLE new_foo AUTO_INCREMENT = 1; | |
| RENAME TABLE foo TO old_foo, new_foo TO foo; | |
| DROP TABLE old_foo; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment