Updated on 2025-10-23 GMT+08:00

partitions

The partitions view displays information about partitioned tables and table partitions in GaussDB. Level-1 partitions and level-2 partitions are recorded separately. This view is read-only. All users have the read permission on this view, but they can read only the records that they have the access permission. Some information in the view is obtained based on statistics. Run ANALYZE before checking the information. (If data is updated in the database, you are advised to delay running ANALYZE.)

Table 1 information_schema.partitions columns

Name

Type

Description

TABLE_CATALOG

varchar(512)

Name of the catalog to which the table belongs. When lower_case_table_names is set to 0, the value of this column is case-sensitive. When lower_case_table_names is set to 1, the value of this column is case-insensitive.

TABLE_SCHEMA

varchar(64)

Name of the schema. When lower_case_table_names is set to 0, the value of this column is case-sensitive. When lower_case_table_names is set to 1, the value of this column is case-insensitive.

TABLE_NAME

varchar(64)

Name of the table. When lower_case_table_names is set to 0, the value of this column is case-sensitive. When lower_case_table_names is set to 1, the value of this column is case-insensitive.

PARTITION_NAME

varchar(64)

Name of the partition.

SUBPARTITION_NAME

varchar(64)

Name of the level-2 partition. If a partition is not a level-2 partition, the value is null.

PARTITION_ORDINAL_POSITION

bigint unsigned

Position of the partition in the table.

SUBPARTITION_ORDINAL_POSITION

bigint unsigned

Position of the level-2 partition in the partition. If a partition is not a level-2 partition, the value is null.

PARTITION_METHOD

varchar(18)

Partitioning policy. If a partition is not a level-1 partition, the value is null.

  • r: range partition.
  • l: list partition.
  • h: hash partition.

SUBPARTITION_METHOD

varchar(12)

Level-2 partitioning policy. If a partition is not a level-2 partition, the value is null.

  • r: range partition.
  • l: list partition.
  • h: hash partition.

PARTITION_EXPRESSION

longtext

Not supported. It is always null.

SUBPARTITION_EXPRESSION

longtext

Not supported. It is always null.

PARTITION_DESCRIPTION

longtext

  • For range partitioning, the upper limit of each partition is displayed.
  • For list partitioning, the value list of each partition is displayed.
  • For hash partitioning, the number of each partition is displayed.

TABLE_ROWS

bigint unsigned

Number of table rows in the partition.

AVG_ROW_LENGTH

bigint unsigned

Not supported. It is always null.

DATA_LENGTH

bigint unsigned

Not supported. It is always null.

MAX_DATA_LENGTH

bigint unsigned

Not supported. It is always null.

INDEX_LENGTH

bigint unsigned

Not supported. It is always null.

DATA_FREE

bigint unsigned

Not supported. It is always null.

CREATE_TIME

datetime

Not supported. It is always null.

UPDATE_TIME

datetime

Not supported. It is always null.

CHECK_TIME

datetime

Not supported. It is always null.

CHECKSUM

bigint unsigned

Not supported. It is always null.

PARTITION_COMMENT

varchar(80)

Not supported. It is always null.

NODEGROUP

varchar(12)

Not supported. It is always null.

TABLESPACE_NAME

varchar(64)

Name of the tablespace to which the partition belongs.