初始表
CREATE TABLE IF NOT EXISTS `time` (
`a` int(11) NOT NULL AUTO_INCREMENT,
`b` int(11) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB;
更改表为partition
ALTER TABLE time
PARTITION BY RANGE(id)(
PARTITION p0 VALUES LESS THAN (3),
PARTITION p1 VALUES LESS THAN (4)
);
添加分区
ALTER TABLE time
ADD PARTITION (
PARTITION p2 VALUES LESS THAN (20)
)
添加分区
ALTER TABLE time
ADD PARTITION (
PARTITION p3 VALUES LESS THAN (30)
)
阅读(1795) | 评论(0) | 转发(0) |