您好,欢迎访问一九零五行业门户网

mysql分区部类

mysql分区类型 分区类型 ? 1、range分区 ? create table employees ( ? ? id int not null, ? ? fname varchar(30), ? ? lname varchar(30), ? ? hired date not null default '1970-01-01', ? ? separated date not null default '9999-12-31', ? ? job_code
mysql分区类型
分区类型
?
1、range分区
?
create table employees (
? ? id int not null,
? ? fname varchar(30),
? ? lname varchar(30),
? ? hired date not null default '1970-01-01',
? ? separated date not null default '9999-12-31',
? ? job_code int not null,
? ? store_id int not null
)
partition by range (store_id) (
? ? partition p0 values less than (6),
? ? partition p1 values less than (11),
? ? partition p2 values less than (16),
? ? partition p3 values less than (21)
);
?
2、list分区
?
create table employees (
? ? id int not null,
? ? fname varchar(30),
? ? lname varchar(30),
? ? hired date not null default '1970-01-01',
? ? separated date not null default '9999-12-31',
? ? job_code int,
? ? store_id int
)
partition by list(store_id)
? ? partition pnorth values in (3,5,6,9,17),
? ? partition peast values in (1,2,10,11,19,20),
? ? partition pwest values in (4,12,13,14,18),
? ? partition pcentral values in (7,8,15,16)
);
?
3、hash分区
?
create table employees (
? ? id int not null,
? ? fname varchar(30),
? ? lname varchar(30),
? ? hired date not null default '1970-01-01',
? ? separated date not null default '9999-12-31',
? ? job_code int,
? ? store_id int
)
partition by hash(year(hired))
partitions 4;
?
4、key分区
?
5、子分区
其它类似信息

推荐信息