mysql 表分区

 

create table ABC

(

   DETAIL_ID            INT not null comment '明细主键',

   partition_para_1     int not null,

   xxx        int not null comment 'xxx',

   primary key (DETAIL_ID, partition_para_1)

)

 

PARTITION BY RANGE(partition_para_1)   (  

PARTITION p1 VALUES LESS THAN (20150514),

PARTITION p2 VALUES LESS THAN (20150515),

PARTITION p1704 VALUES LESS THAN (MAXVALUE) );

 

 

验证是否创建成功执行下面sql

explain partitions select * from TT_PAGE_GROUP_DETAIL where partition_para_1=20150515;

 

 

 


 
 

 

 

你可能感兴趣的:(mysql)