The Information Schema PARTITIONS contains information about table partitions, with each record corresponding to a single partition or subpartition of a partitioned table. Each non-partitioned table also has a record in the PARTITIONS table, but most of the values are NULL.

It contains the following columns:

ColumnDescription
TABLE_CATALOGAlways def.
TABLE_SCHEMADatabase name.
TABLE_NAMETable name containing the partition.
PARTITION_NAMEPartition name.
SUBPARTITION_NAMESubpartition name, or NULL if not a subpartition.
PARTITION_ORDINAL_POSITIONOrder of the partition starting from 1.
SUBPARTITION_ORDINAL_POSITIONOrder of the subpartition starting from 1.
PARTITION_METHODThe partitioning type; one of RANGE, LIST, HASH, LINEAR HASH, KEY or LINEAR KEY.
SUBPARTITION_METHODSubpartition type; one of HASH, LINEAR HASH, KEY or LINEAR KEY, or NULL if not a subpartition.
PARTITION_EXPRESSIONExpression used to create the partition by the CREATE or ALTER statement.
SUBPARTITION_EXPRESSIONExpression used to create the subpartition by the CREATE or ALTER statement, or NULL if not a subpartition.
PARTITION_DESCRIPTIONFor a RANGE partition, contains either MAXINTEGER or an integer, as set in the VALUES LESS THAN clause. For a LIST partition, contains a comma-separated list of integers, as set in the VALUES IN. NULL if another type of partition.
TABLE_ROWSNumber of rows in the table (may be an estimate for some storage engines).
AVG_ROW_LENGTHAverage row length, that is DATA_LENGTH divided by TABLE_ROWS
DATA_LENGTHTotal number of bytes stored in all rows of the partition.
MAX_DATA_LENGTHMaximum bytes that could be stored in the partition.
INDEX_LENGTHSize in bytes of the partition index file.
DATA_FREEUnused bytes allocated to the partition.
CREATE_TIMETime the partition was created
UPDATE_TIMETime the partition was last modified.
CHECK_TIMETime the partition was last checked, or NULL for storage engines that don't record this information.
CHECKSUMChecksum value, or NULL if none.
PARTITION_COMMENTPartition comment, truncated to 80 characters, or an empty string if no comment.
NODEGROUPNode group, only used for MySQL Cluster, defaults to 0.
TABLESPACE_NAMEAlways default.

Comments

Comments loading...