接下来的两个部分讨论 COLUMNS 分区,它们是 RANGE 和 LIST 分区的变体。COLUMNS 分区允许在分区键中使用多个列。所有这些列都会被考虑用于将行放入分区的目的,并用于确定在分区修剪中需要检查哪些分区以匹配行。The next two sections discuss
COLUMNS
partitioning, which are variants on
RANGE and LIST
partitioning. COLUMNS partitioning enables
the use of multiple columns in partitioning keys. All of these
columns are taken into account both for the purpose of placing
rows in partitions and for the determination of which partitions
are to be checked for matching rows in partition pruning.
此外,RANGE COLUMNS 分区和 LIST COLUMNS 分区都支持使用非整数列来定义值范围或列表成员。允许的数据类型如下所示:In addition, both RANGE COLUMNS partitioning
and LIST COLUMNS partitioning support the use
of non-integer columns for defining value ranges or list
members. The permitted data types are shown in the following
list:
所有整数类型:
TINYINT、SMALLINT、MEDIUMINT、INT(INTEGER)和BIGINT。(这与按RANGE和LIST分区时相同。)All integer types:TINYINT,SMALLINT,MEDIUMINT,INT(INTEGER), andBIGINT. (This is the same as with partitioning byRANGEandLIST.)其他数值数据类型(例如
DECIMAL或FLOAT)不支持作为分区列。Other numeric data types (such asDECIMALorFLOAT) are not supported as partitioning columns.DATE和DATETIME。DATEandDATETIME.使用其他与日期或时间相关的数据类型的列不支持作为分区列。Columns using other data types relating to dates or times are not supported as partitioning columns.
以下字符串类型:
CHAR、VARCHAR、BINARY,以及VARBINARY。The following string types:CHAR,VARCHAR,BINARY, andVARBINARY.TEXT和BLOB列不支持用作分区列。TEXTandBLOBcolumns are not supported as partitioning columns.
接下来的两节对 RANGE COLUMNS 和 LIST COLUMNS 分区的讨论假设您已经熟悉 MySQL 5.1 及其以后的版本中基于范围和列表的分区;有关这些的更多信息,请参阅 第 26.2.1 节,“RANGE 分区” 和 第 26.2.2 节,“LIST 分区”。The discussions of RANGE COLUMNS and
LIST COLUMNS partitioning in the next two
sections assume that you are already familiar with partitioning
based on ranges and lists as supported in MySQL 5.1 and later;
for more information about these, see
Section 26.2.1, “RANGE Partitioning”, and
Section 26.2.2, “LIST Partitioning”, respectively.