0

我有一张包含数十万条记录的表。如何按月对表进行分区?

4

1 回答 1

1

您可以在其ALTER TABLE上创建新的PARITIONS

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
);
于 2012-08-08T09:59:12.893 回答