partitions

partitions provides information about table partitions.

The following fields are provided in partitions:

FieldDescription
TABLE_CATALOGThe name of the catalog to which the table belongs. This value is always def.
TABLE_SCHEMAThe name of the database to which the table belongs.
TABLE_NAMEThe name of the table containing the partition.
PARTITION_NAMEThe name of the partition.
SUBPARTITION_NAMEIf the PARTITIONS table row represents a subpartition, the name of subpartition; otherwise NULL.For NDB: This value is always NULL.
PARTITION_ORDINAL_POSITIONAll partitions are indexed in the same order as they are defined, with 1 being the number assigned to the first partition. The indexing can change as partitions are added, dropped, and reorganized; the number shown is this column reflects the current order, taking into account any indexing changes.
PARTITION_METHODValid values: RANGE, LIST, HASH, LINEAR HASH, KEY, or LINEAR KEY.
SUBPARTITION_METHODValid values: HASH, LINEAR HASH, KEY, or LINEAR KEY
PARTITION_EXPRESSIONThe expression for the partitioning function used in the CREATE TABLE or ALTER TABLE statement that created the table's current partitioning scheme.
SUBPARTITION_EXPRESSIONThis works in the same fashion for the subpartitioning expression that defines the subpartitioning for a table as PARTITION_EXPRESSION does for the partitioning expression used to define a table's partitioning. If the table has no subpartitions, this column is NULL.
PARTITION_DESCRIPTIONThis column is used for RANGE and LIST partitions. For a RANGE partition, it contains the value set in the partition's VALUES LESS THAN clause, which can be either an integer or MAXVALUE. For a LIST partition, this column contains the values defined in the partition's VALUES IN clause, which is a list of comma-separated integer values.For partitions whose PARTITION_METHOD is other than RANGE or LIST, this column is always NULL.
TABLE_ROWSThe number of table rows in the partition.
AVG_ROW_LENGTHThe average length of the rows stored in this partition or subpartition, in bytes. This is the same as DATA_LENGTH divided by TABLE_ROWS.
DATA_LENGTHThe total length of all rows stored in this partition or subpartition, in bytes; that is, the total number of bytes stored in the partition or subpartition.
MAX_DATA_LENGTHThe maximum number of bytes that can be stored in this partition or subpartition.
INDEX_LENGTHThe length of the index file for this partition or subpartition, in bytes.
DATA_FREEThe number of bytes allocated to the partition or subpartition but not used.
CREATE_TIMEThe time that the partition or subpartition was created.
UPDATE_TIMEThe time that the partition or subpartition was last modified.
CHECK_TIMEThe last time that the table to which this partition or subpartition belongs was checked.
CHECKSUMThe checksum value, if any; otherwise NULL.
PARTITION_COMMENTThe text of the comment, if the partition has one. If not, this value is empty.
NODEGROUPThis is the nodegroup to which the partition belongs.
TABLESPACE_NAMEThe name of the tablespace to which the partition belongs.
In this article