Skip to content

Instantly share code, notes, and snippets.

@islander
Created October 15, 2015 04:44
Show Gist options
  • Select an option

  • Save islander/b9047ef045eb88ecea92 to your computer and use it in GitHub Desktop.

Select an option

Save islander/b9047ef045eb88ecea92 to your computer and use it in GitHub Desktop.
MySQL fast drop big table
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