分区测试
删除表
drop table part
过程
delimiter #
create procedure insert_200000()begin
declare i int default 0;
while i<200000
do
insert into part values('',rand(100000));
set i=i+1;
end while;
end
#
分区
alter table part
partition BY RANGE (id) (
partition p0 VALUES LESS THAN (50000),
partition p1 VALUES LESS THAN (100000),
partition p2 VALUES LESS THAN (150000),
partition p3 VALUES LESS THAN (maxvalue)
);
复制记录
insert into not_part select * from part
200000+的数据分区没有用