mysql 分区

  ALTER TABLE sttrade5500.owner_order PARTITION BY RANGE (TO_DAYS(order_date)) (
   PARTITION P201807 VALUES LESS THAN (TO_DAYS(20180801)),
   PARTITION P201808 VALUES LESS THAN (TO_DAYS(20180901)),
   PARTITION P201809 VALUES LESS THAN (TO_DAYS(20181001)),
   PARTITION P0 VALUES LESS THAN MAXVALUE );


分区字段需要是主键

 

 

你可能感兴趣的:(数据库)