Note
This view was introduced in OceanBase Database V1.4.
Purpose
The information_schema.PARTITIONS view displays the information about partitions.
Columns
| Column | Type | Nullable? | Description |
|---|---|---|---|
| TABLE_CATALOG | text | NO | The catalog. The value of this column is always def. |
| TABLE_SCHEMA | varchar(128) | NO | The name of the database. |
| TABLE_NAME | varchar(256) | NO | The name of the table. |
| PARTITION_NAME | varchar(64) | NO | The name of the partition. |
| SUBPARTITION_NAME | varchar(64) | NO | The name of the subpartition. |
| PARTITION_ORDINAL_POSITION | bigint(20) unsigned | NO | The position of the current partition in all partitions. |
| SUBPARTITION_ORDINAL_POSITION | bigint(20) unsigned | NO | The position of the current subpartition in all subpartitions. |
| PARTITION_METHOD | varchar(13) | NO | The partitioning type. |
| SUBPARTITION_METHOD | varchar(13) | NO | The subpartitioning type. |
| PARTITION_EXPRESSION | text | NO | The expression for the partitioning function. |
| SUBPARTITION_EXPRESSION | text | NO | The expression for the subpartitioning function. |
| PARTITION_DESCRIPTION | text | NO | The description for RANGE and LIST partitions. |
| SUBPARTITION_DESCRIPTION | text | NO | The description for RANGE and LIST subpartitions. |
| TABLE_ROWS | bigint(20) unsigned | NO | The number of rows of the partition. |
| AVG_ROW_LENGTH | bigint(21) unsigned | NO | The average length of rows stored in the partition or subpartition. |
| DATA_LENGTH | bigint(0) unsigned | NO | The total number of bytes stored in the partition or subpartition. It indicates the storage space occupied by the partition or subpartition, which is measured by macroblock size in bytes.
NoteIn OceanBase Database V4.2.4 and later, the value of this column is no longer |
| MAX_DATA_LENGTH | bigint(0) unsigned | NO | At present, this column is not supported and its value is 0 by default. |
| INDEX_LENGTH | bigint(0) unsigned | NO | The total index length. It indicates the storage space occupied by the index of the partition or subpartition, which is measured by macroblock size in bytes.
NoteIn OceanBase Database V4.2.4 and later, the value of this column is no longer |
| DATA_FREE | bigint(0) unsigned | NO | At present, this column is not supported and its value is 0 by default. |
| CREATE_TIME | timestamp(6) | NO | The time when the partition was created. |
| UPDATE_TIME | datetime | NO | At present, this column is not supported and its value is NULL by default. |
| CHECK_TIME | datetime | YES | At present, this column is not supported and its value is NULL by default. |
| CHECKSUM | bigint(0) | NO | At present, this column is not supported and its value is NULL by default. |
| PARTITION_COMMENT | text | NO | The comment on the partition. |
| NODEGROUP | varchar(256) | NO | The node group to which the partition belongs. |
| TABLESPACE_NAME | varchar(268) | NO | The name of the tablespace containing the partition. |
Sample query
obclient> SELECT * FROM information_schema.PARTITIONS\G
The query result is as follows:
*************************** 1. row ***************************
TABLE_CATALOG: def
TABLE_SCHEMA: sys_external_tbs
TABLE_NAME: __all_external_alert_log_info
PARTITION_NAME: NULL
SUBPARTITION_NAME: NULL
PARTITION_ORDINAL_POSITION: NULL
SUBPARTITION_ORDINAL_POSITION: NULL
PARTITION_METHOD: NULL
SUBPARTITION_METHOD: NULL
PARTITION_EXPRESSION: NULL
SUBPARTITION_EXPRESSION: NULL
PARTITION_DESCRIPTION: NULL
SUBPARTITION_DESCRIPTION: NULL
TABLE_ROWS: NULL
AVG_ROW_LENGTH: NULL
DATA_LENGTH: 0
MAX_DATA_LENGTH: NULL
INDEX_LENGTH: 0
DATA_FREE: NULL
CREATE_TIME: 2024-06-13 18:22:53.533153
UPDATE_TIME: NULL
CHECK_TIME: NULL
CHECKSUM: NULL
PARTITION_COMMENT: NULL
NODEGROUP: default
TABLESPACE_NAME: NULL
1 row in set (0.004 sec)