MySQL Partition Table -- column Partition

Source: Internet
Author: User

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 -----

 

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.