How make month wise partitioning in existing mysql table?

这一生的挚爱 提交于 2019-12-12 05:51:45

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!