Created
September 8, 2017 08:18
-
-
Save frankyaorenjie/8957f4be9c5111a0a9b1b36ac82f8e30 to your computer and use it in GitHub Desktop.
mysql partition by month
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
ALTER TABLE dashboard.search_stats_hourly_2018 | |
PARTITION BY RANGE ( MONTH(date_hour) ) ( | |
PARTITION p01 VALUES LESS THAN (2), | |
PARTITION p02 VALUES LESS THAN (3), | |
PARTITION p03 VALUES LESS THAN (4), | |
PARTITION p04 VALUES LESS THAN (5), | |
PARTITION p05 VALUES LESS THAN (6), | |
PARTITION p06 VALUES LESS THAN (7), | |
PARTITION p07 VALUES LESS THAN (8), | |
PARTITION p08 VALUES LESS THAN (9), | |
PARTITION p09 VALUES LESS THAN (10), | |
PARTITION p10 VALUES LESS THAN (11), | |
PARTITION p11 VALUES LESS THAN (12), | |
PARTITION p12 VALUES LESS THAN (13) | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment