子分割槽也稱為復合分割槽,就是在已有分割槽的基礎上再進行分割槽。mysql允許在range和list的分割槽的基礎上再進行hash或key分割槽。
create table t7( a int,b date) engine=innodb
partition by range (year(b))
subpartition by hash(to_days(b))
subpartitions 2 (
partition p0 values less than (1990),
partition p1 values less than (2000),
partition p2 values less than maxvalue);
指定子分割槽的名稱:
create table t8( a int,b date) engine=innodb
partition by range (year(b))
subpartition by hash(to_days(b)) (
partition p0 values less than (1990) (
subpartition s0,
subpartition s1
),partition p1 values less than (2000) (
subpartition s3,
subpartition s4
),partition p2 values less than maxvalue (
subpartition s5,
subpartition s6));
指定子分割槽表的儲存空間:
create table t9( a int,b date) engine=myisam
partition by range (year(b))
subpartition by hash(to_days(b)) (
partition p0 values less than (1990) (
subpartition s0
data directory = '/disk0/data'
index directory = '/disk0/idx',
subpartition s1
data directory = '/disk1/data'
index directory = '/disk1/idx'
),partition p1 values less than (2000) (
subpartition s2
data directory = '/disk2/data'
index directory = '/disk2/idx',
subpartition s3
data directory = '/disk3/data'
index directory = '/disk3/idx'
),partition p2 values less than maxvalue (
subpartition s4
data directory = '/disk4/data'
index directory = '/disk4/idx',
subpartition s5
data directory = '/disk5/data'
index directory = '/disk5/idx'));
mysql子分割槽 MYSQL 子分割槽詳解
子分割槽 子分割槽是分割槽表中每個分割槽的再次分割。例如,考慮下面的create table語句 create table ts id int,purchased date partition by range year purchased subpartition by hash to days ...
mysql 子分割槽的寫法 MySQL 子分割槽
介紹 子分割槽其實是對每個分割槽表的每個分割槽進行再次分隔,目前只有range和list分割槽的表可以再進行子分割槽,子分割槽只能是hash或者key分割槽。子分割槽可以將原本的資料進行再次的分割槽劃分。一 建立子分割槽 子分割槽由兩種建立方法,一種是不定義每個子分割槽子分割槽的名字和路徑由分割槽決...
mysql修改子分割槽 建立MySQL子分割槽方法
建立mysql子分割槽方法 閱讀 216 本文主要給大家介紹建立mysql子分割槽方法,文章內容都是筆者用心摘選和編輯的,具有一定的針對性,對大家的參考意義還是比較大的,下面跟筆者一起了解下建立mysql子分割槽方法吧。create table t log id int 11 not null au...