Created
March 11, 2021 17:06
-
-
Save yeisoncruz16/9c67bab150481cfd2f4f10c4e04b219b to your computer and use it in GitHub Desktop.
How to truncate Large Mysql Tables
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
CREATE TABLE new_foo LIKE foo; | |
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
Reference: https://stackoverflow.com/questions/879327/quickest-way-to-delete-enormous-mysql-table