Created
December 24, 2013 07:57
-
-
Save badcrc/8110132 to your computer and use it in GitHub Desktop.
Reorganize MySQL Partitions
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
ALTER TABLE TABLE_NAME | |
REORGANIZE PARTITION pmax INTO ( | |
PARTITION p201401 VALUES LESS THAN ('2014-01-01 00:00:00'), | |
PARTITION p201402 VALUES LESS THAN ('2014-02-01 00:00:00'), | |
PARTITION p201403 VALUES LESS THAN ('2014-03-01 00:00:00'), | |
PARTITION p201404 VALUES LESS THAN ('2014-04-01 00:00:00'), | |
PARTITION p201405 VALUES LESS THAN ('2014-05-01 00:00:00'), | |
PARTITION p201406 VALUES LESS THAN ('2014-06-01 00:00:00'), | |
PARTITION p201407 VALUES LESS THAN ('2014-07-01 00:00:00'), | |
PARTITION p201408 VALUES LESS THAN ('2014-08-01 00:00:00'), | |
PARTITION p201409 VALUES LESS THAN ('2014-09-01 00:00:00'), | |
PARTITION p201410 VALUES LESS THAN ('2014-10-01 00:00:00'), | |
PARTITION p201411 VALUES LESS THAN ('2014-11-01 00:00:00'), | |
PARTITION p201412 VALUES LESS THAN ('2014-12-01 00:00:00'), | |
PARTITION pmax VALUES LESS THAN (MAXVALUE) | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment