partition分区

1、按id拆分

mysql -uroot
mysql>use test;
mysql>create table topic ( tid int primary key auto_increment,title char() not null default '')engine myisam charset utf8 partition by range(tid)(partition t0 values less than (),partition t1 values less than (),partition t2 values less than(MAXVALUE));
#插入t1
mysql>insert into topic(title) values('aa');
#插入t2
mysql>insert into topic(id,title) values(,'aa');

2、按表数据拆分

mysql -uroot
mysql>use test;
mysql>create table area(aid int,zone)engine mysiam charset utf8;
mysql>insert into area values(,'bj'),(,'hb'),(,'sx'),(,'ah');
mysql>create table user(uid int,uname char(),aid int)engine myisam charset utf8 partition by list(aid)(partition bj values in (),partition hb values in (),partition xs values in (),partition ah values in ());
#插入bj块
mysql>insert into user(uname,aid) values('poly',);
#插入hb块
mysql>insert into user(uname,aid) values('lily',);
上一篇:Deep Learning Papers


下一篇:Javascript 浮点运算问题分析与解决