Author: skate
Time: 2012/11/28
MySQL partition ---- column Partition
MySQL supports column partitioning from MySQL 5.5. It can also be considered as an upgraded version of range and list partitions. The column partition can require the partition key to be integer or be converted to interger, in addition, range column can partition multiple columns. After 5.5, you can replace range and list partitions with column partitions. However, column partitions are restricted and column partitions do not accept expressions, only common columns are accepted.
Column range partition in a single column
Mysql> show create table list_c;
Create Table 'list _ C '(
'C1' int (11) default null,
'C2 'int (11) default null
) Engine = InnoDB default charset = Latin1
/*! 50500 partition by range columns (C1)
(Partition P0 values less than (5) engine = InnoDB,
Partition P1 values less than (10) engine = InnoDB )*/
Multi-column range partitioning
Mysql> show create table list_c;
Create Table 'list _ C '(
'C1' int (11) default null,
'C2 'int (11) default null,
'C3' char (20) default null
) Engine = InnoDB default charset = Latin1
/*! 50500 partition by range columns (C1, C3)
(Partition P0 values less than (5, 'aaa') engine = InnoDB,
Partition P1 values less than (10, 'bbb ') engine = InnoDB )*/
Column list partition in a single column
Mysql> show create table list_c;
Create Table 'list _ C '(
'C1' int (11) default null,
'C2 'int (11) default null,
'C3' char (20) default null
) Engine = InnoDB default charset = Latin1
/*! 50500 partition by list columns (C3)
(Partition P0 values in ('aaa') engine = InnoDB,
Partition P1 values in ('bbb ') engine = InnoDB )*/
Data Types supported by column:
1. All Integer types, float and decimal types are not supported.
2. date type: Date and datetime. Other types are not supported.
3. character types: Char, varchar, binary, and varbinary, blob, and text are not supported.
----- End -----