Overview
Scenarios
Product Architecture
Instance Types
Compatibility Notes
Usage specification recommendations
INFORMATION_SCHEMA.PARTITIONS is used to provide detailed partitioning information for all partitioned tables in the database, including partition definitions, storage parameters, statistics, and so on.Field Name | Type | Description |
TABLE_CATALOG | varchar(64) | The name of the directory to which the table belongs, this value is always 'def'. |
TABLE_SCHEMA | varchar(64) | The name of the database to which the table belongs. |
TABLE_NAME | varchar(64) | Table name. |
PARTITION_NAME | varchar(64) | Partition name. |
SUBPARTITION_NAME | varchar(64) | If the row represents a subpartition (subpartition), it is the name of the subpartition; otherwise, it is NULL. |
PARTITION_ORDINAL_POSITION | int unsigned | The ordinal position of the partition within the table. |
SUBPARTITION_ORDINAL_POSITION | int unsigned | The ordinal position of the subpartition within the partition. |
PARTITION_METHOD | varchar(13) | Partitioning method (RANGE, LIST, HASH, KEY, and so on) |
SUBPARTITION_METHOD | varchar(13) | Subpartition method. |
PARTITION_EXPRESSION | varchar(2048) | Partition expression. |
SUBPARTITION_EXPRESSION | text | Subpartition expression. |
PARTITION_DESCRIPTION | text | Partition description (such as boundary values for RANGE partitions). |
TABLE_ROWS | bigint unsigned | Estimated number of rows in the partition. |
AVG_ROW_LENGTH | bigint unsigned | Average row length in the partition. |
DATA_LENGTH | bigint unsigned | Length of partition data (bytes). |
MAX_DATA_LENGTH | bigint unsigned | Maximum length of partition data. |
INDEX_LENGTH | bigint unsigned | Length of the partition index. |
DATA_FREE | bigint unsigned | Unused space in the partition. |
CREATE_TIME | timestamp | Time of partition creation. |
UPDATE_TIME | datetime | Time of the last partition update. |
CHECK_TIME | datetime | Time of the last partition check. |
CHECKSUM | bigint | Value of the partition checksum. |
PARTITION_COMMENT | text | Partition comment. |
NODEGROUP | varchar(256) | Node group information. |
TABLESPACE_NAME | varchar(268) | TABLESPACE NAME. |
TINDEX_ID | int unsigned | TINDEX_ID of the table or partition. |
TINDEX_ID_STORAGE_FORMAT | varchar(8) | Storage format of the table index ID. |
DATA_SPACE_TYPE | varchar(128) | DATA SPACE TYPE. |
SE_PRIVATE_DATA | mediumtext | STORAGE ENGINE PRIVATE DATA. |
TABLE_SCHEMA_VERSION | int unsigned | Version number of the table structure. |
TABLE_SCHEMA_STATUS | smallint unsigned | Status of the table structure. |
TABLE_EXTRA_INFO | mediumtext | Additional information of the table (JSON format). |
TABLE_SE_PRIVATE_DATA | mediumtext | TABLE STORAGE ENGINE PRIVATE DATA. |
sales table with two-level partitioning:PARTITIONS view: It displays actual partition/subpartition information. For tables with subpartitions, it does not display summary information of the primary partitions. As shown below, the query result consists of 4 rows of data, corresponding to 4 subpartitions respectively.# Create a partitioned table exampletdsql > CREATE TABLE sales (id INT NOT NULL,sale_date DATE NOT NULL,amount DECIMAL(10,2))PARTITION BY RANGE (YEAR(sale_date))SUBPARTITION BY HASH(MONTH(sale_date))SUBPARTITIONS 2 (PARTITION p0 VALUES LESS THAN (2023),PARTITION p1 VALUES LESS THAN (2025));# Query partition informationtdsql > select * from INFORMATION_SCHEMA.partitions where TABLE_SCHEMA="test" and TABLE_NAME="sales"\\G;*************************** 1. row ***************************TABLE_CATALOG: defTABLE_SCHEMA: testTABLE_NAME: salesPARTITION_NAME: p0SUBPARTITION_NAME: p0sp0PARTITION_ORDINAL_POSITION: 1SUBPARTITION_ORDINAL_POSITION: 1PARTITION_METHOD: RANGESUBPARTITION_METHOD: HASHPARTITION_EXPRESSION: year(`sale_date`)SUBPARTITION_EXPRESSION: month(`sale_date`)PARTITION_DESCRIPTION: 2023TABLE_ROWS: 0AVG_ROW_LENGTH: 0DATA_LENGTH: 0MAX_DATA_LENGTH: 0INDEX_LENGTH: 0DATA_FREE: 0CREATE_TIME: 2025-11-09 16:34:32UPDATE_TIME: NULLCHECK_TIME: NULLCHECKSUM: NULLPARTITION_COMMENT:NODEGROUP: defaultTABLESPACE_NAME: NULLTINDEX_ID: 10032TINDEX_ID_STORAGE_FORMAT: 00002730DATA_SPACE_TYPE: DATA_SPACE_TYPE_USERSE_PRIVATE_DATA: create_data_obj_task_id=29572817330634866;distribution_policy_id=1;hidden_pk_autoinc_tindex_id=10033;schema_status=0;TABLE_SCHEMA_VERSION: 1TABLE_SCHEMA_STATUS: 0TABLE_EXTRA_INFO: {"version":3,"create_ts":0}TABLE_SE_PRIVATE_DATA: autoinc_version=1;create_data_obj_task_id=29572817330634866;distribution_policy_id=1;origin_db=test;origin_table=sales;partition_policy_id=0;sync_table=0;*************************** 2. row ***************************TABLE_CATALOG: defTABLE_SCHEMA: testTABLE_NAME: salesPARTITION_NAME: p0SUBPARTITION_NAME: p0sp1PARTITION_ORDINAL_POSITION: 1SUBPARTITION_ORDINAL_POSITION: 2PARTITION_METHOD: RANGESUBPARTITION_METHOD: HASHPARTITION_EXPRESSION: year(`sale_date`)SUBPARTITION_EXPRESSION: month(`sale_date`)PARTITION_DESCRIPTION: 2023TABLE_ROWS: 0AVG_ROW_LENGTH: 0DATA_LENGTH: 0MAX_DATA_LENGTH: 0INDEX_LENGTH: 0DATA_FREE: 0CREATE_TIME: 2025-11-09 16:34:32UPDATE_TIME: NULLCHECK_TIME: NULLCHECKSUM: NULLPARTITION_COMMENT:NODEGROUP: defaultTABLESPACE_NAME: NULLTINDEX_ID: 10034TINDEX_ID_STORAGE_FORMAT: 00002732DATA_SPACE_TYPE: DATA_SPACE_TYPE_USERSE_PRIVATE_DATA: create_data_obj_task_id=29572817330634866;distribution_policy_id=1;hidden_pk_autoinc_tindex_id=10035;schema_status=0;TABLE_SCHEMA_VERSION: 1TABLE_SCHEMA_STATUS: 0TABLE_EXTRA_INFO: {"version":3,"create_ts":0}TABLE_SE_PRIVATE_DATA: autoinc_version=1;create_data_obj_task_id=29572817330634866;distribution_policy_id=1;origin_db=test;origin_table=sales;partition_policy_id=0;sync_table=0;*************************** 3. row ***************************TABLE_CATALOG: defTABLE_SCHEMA: testTABLE_NAME: salesPARTITION_NAME: p1SUBPARTITION_NAME: p1sp0PARTITION_ORDINAL_POSITION: 2SUBPARTITION_ORDINAL_POSITION: 1PARTITION_METHOD: RANGESUBPARTITION_METHOD: HASHPARTITION_EXPRESSION: year(`sale_date`)SUBPARTITION_EXPRESSION: month(`sale_date`)PARTITION_DESCRIPTION: 2025TABLE_ROWS: 0AVG_ROW_LENGTH: 0DATA_LENGTH: 0MAX_DATA_LENGTH: 0INDEX_LENGTH: 0DATA_FREE: 0CREATE_TIME: 2025-11-09 16:34:32UPDATE_TIME: NULLCHECK_TIME: NULLCHECKSUM: NULLPARTITION_COMMENT:NODEGROUP: defaultTABLESPACE_NAME: NULLTINDEX_ID: 10037TINDEX_ID_STORAGE_FORMAT: 00002735DATA_SPACE_TYPE: DATA_SPACE_TYPE_USERSE_PRIVATE_DATA: create_data_obj_task_id=29572817330634866;distribution_policy_id=1;hidden_pk_autoinc_tindex_id=10038;schema_status=0;TABLE_SCHEMA_VERSION: 1TABLE_SCHEMA_STATUS: 0TABLE_EXTRA_INFO: {"version":3,"create_ts":0}TABLE_SE_PRIVATE_DATA: autoinc_version=1;create_data_obj_task_id=29572817330634866;distribution_policy_id=1;origin_db=test;origin_table=sales;partition_policy_id=0;sync_table=0;*************************** 4. row ***************************TABLE_CATALOG: defTABLE_SCHEMA: testTABLE_NAME: salesPARTITION_NAME: p1SUBPARTITION_NAME: p1sp1PARTITION_ORDINAL_POSITION: 2SUBPARTITION_ORDINAL_POSITION: 2PARTITION_METHOD: RANGESUBPARTITION_METHOD: HASHPARTITION_EXPRESSION: year(`sale_date`)SUBPARTITION_EXPRESSION: month(`sale_date`)PARTITION_DESCRIPTION: 2025TABLE_ROWS: 0AVG_ROW_LENGTH: 0DATA_LENGTH: 0MAX_DATA_LENGTH: 0INDEX_LENGTH: 0DATA_FREE: 0CREATE_TIME: 2025-11-09 16:34:32UPDATE_TIME: NULLCHECK_TIME: NULLCHECKSUM: NULLPARTITION_COMMENT:NODEGROUP: defaultTABLESPACE_NAME: NULLTINDEX_ID: 10039TINDEX_ID_STORAGE_FORMAT: 00002737DATA_SPACE_TYPE: DATA_SPACE_TYPE_USERSE_PRIVATE_DATA: create_data_obj_task_id=29572817330634866;distribution_policy_id=1;hidden_pk_autoinc_tindex_id=10040;schema_status=0;TABLE_SCHEMA_VERSION: 1TABLE_SCHEMA_STATUS: 0TABLE_EXTRA_INFO: {"version":3,"create_ts":0}TABLE_SE_PRIVATE_DATA: autoinc_version=1;create_data_obj_task_id=29572817330634866;distribution_policy_id=1;origin_db=test;origin_table=sales;partition_policy_id=0;sync_table=0;4 rows in set (0.05 sec)
피드백