Please indicate the source of the original reprint: http://agilestyle.iteye.com/blog/2358878
partition
Partitioning is a design pattern for tables. Correct partitioning can greatly improve the query efficiency of the database and complete higher-quality SQL programming. But if the wrong use of partition, or too superstitious partition, then partition may bring devastating results.
The MySQL database added support for partitioning in version 5.1. Partitioning is the process of breaking a table or index into smaller, more manageable parts. As far as the application accessing the database is concerned, logically, there is only one table or one index, but physically this table or index may be composed of dozens of physical partitions. Each partition is an independent object that can be processed on its own or as part of a larger object.
The partition type supported by MySQL database is horizontal partition , and vertical partition is not supported.
- Horizontal partitioning: refers to allocating records of different rows in the same table to different physical files
- Vertical partitioning: refers to allocating records of different columns in the same table to different physical files
In addition, MySQL's partition is a local partition index , and a partition stores both data and indexes. Global partitioning means that data is stored in each partition, but the indexes of all data are placed in one object. Currently, MySQL database does not support global partitioning.
The current MySQL database supports the following types of partitions
- RANGE partitioning : Row data is placed into partitions based on column values in a given contiguous range. MySQL5.5 began to support the partition of RANGE COLUMNS
- LIST partition : Same as the RANGE partition type, except that the LIST partition is oriented towards discrete values. MySQL5.5 began to support LIST COLUMNS partition
- HASH partition : partition according to the return value of the user-defined expression. The return value cannot be a negative number.
- KEY partition : partition according to the hash function provided by the MySQL database
Reference
Inside MySQL Technology: SQL Programming by Jiang Chengyao