问题
I have a table with hundreds of thousands of records. How to partition the table, month-wise?
回答1:
You can ALTER TABLE to create new PARITIONS on it.
ALTER TABLE table_name PARTITION BY RANGE (MONTH(date_column)
(
PARTITION JAN VALUES LESS THAN (2),
PARTITION FEB VALUES LESS THAN (3),
...
PARTITION DEC VALUES LESS THAN MAXVALUE
);
来源:https://stackoverflow.com/questions/11862051/how-make-month-wise-partitioning-in-existing-mysql-table