MySQL partition overview environment: www.2cto.com [html] mysql> select version (); + ----------- + | version () | + ----------- + | 5.5.28 | + ----------- + 1 row in set (0.00 sec) partition is a partition of the design mode of a table. It is partitioned and managed with the focus on high availability (management ), the secondary value is the performance improvement. In addition, the storage engine layer is transparent to the application layer. Supported partition types: For tables: partition horizontal partitioning → records of different rows in the same table are allocated to different physical files for the index: partial partial partition index → A partition stores both data and indexes. You can run the following command to check whether the current database has enabled the partition Function: [SQL] mysql> show variables like '% partition % '; + ------------------- + ------- + | Variable_name | Value | + ----------------- + ------- + | have_partitioning | YES | + ------------------- + ------- + 1 row in set (0.00 sec) MySQL partition type: ● RANGE partition ●list partition ●hash partition ●key partition no matter what type of partition is created, if the table has a primary KEY or a unique index, the partition column must be an integral part of the unique index. [SQL] mysql> create table t (col1 int not null,-> col2 int not null,-> col3 int not null,-> col4 int not null, -> unique key (col1, col2)-> partition by hash (col3)-> partitions 4; ERROR 1503 (HY000 ): a primary key must include all columns in the table's partitioning function mysql> create table t (col1 int not null,-> col2 int not null,-> col3 int not null, -> col4 int not null,-> unique key (col1, col2)-> partition by hash (col2)-> partitions 4; Query OK, 0 rows affected( 0.08 sec)