Created
April 25, 2016 16:16
-
-
Save sawantuday/4c6f0c39fb66f5a65bc03085f9d60732 to your computer and use it in GitHub Desktop.
Reclaim unused space from large partitioned MySQL tables.
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 tempUrls like urls; | |
| insert into tempUrls; | |
| select * from urls where id < 100; | |
| delete from urls where id < 100 limit 50; | |
| alter table urls REBUILD PARTITION p000; | |
| alter table urls ANALYZE PARTITION p000; | |
| insert ignore into urls select * from tempUrls; | |
| drop table tempUrls; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment