tencent cloud

TDSQL Boundless

PARTITION_POLICY_PARTITIONS

PDF
Modo Foco
Tamanho da Fonte
Última atualização: 2026-02-10 11:06:29

Function

INFORMATION_SCHEMA.PARTITION_POLICY_PARTITIONS is used to query PARTITION POLICY rules in the system. INFORMATION_SCHEMA.PARITTION_POLICIES and INFORMATION_SCHEMA.PARTITION_POLICY_PARTITIONS form the definition of PARTITION POLICY rules, similar to INFORMATION_SCHEMA.TABLES and INFORMATION_SCHEMA.PARTITIONS.
PARTITION POLICY PARTITION is a partition of a PARTITION POLICY, similar to the relationship between PARTITION and TABLE.

Field Description

Field Name
Type
Description
PARTITION_POLICY_ID
BIGINT UNSIGNED
the unique ID of PARTITION POLICY.
PARTITION_POLICY_NAME
VARCHAR(64)
the unique NAME of PARTITION POLICY.
PARTITION_ID
BIGINT UNSIGNED
Each partition of a PARTITION POLICY has a unique ID.
PARTITION_NAME
VARCHAR(64)
Partition NAME.
SUBPARTITION_NAME
VARCHAR(64)
Sub-partition NAME.
PARTITION_ORDINAL_POSITION
INT UNSIGNED
Partition position: the ordinal position of the partition in the table.
SUBPARTITION_ORDINAL_POSITION
INT UNSIGNED
Sub-partition position: the ordinal position of the sub-partition within the partition.
PARTITION_METHOD
VARCHAR(13)
Partition types, common ones include: RANGE, LIST, HASH, KEY.
SUBPARTITION_METHOD
VARCHAR(13)
Sub-partition type.
PARTITION_EXPRESSION
VARCHAR(2048)
The expression of the partition function used in the CREATE TABLE or ALTER TABLE statements for the current partition scheme.
SUBPARTITION_EXPRESSION
VARCHAR(2048)
Subpartition expression, defined in the same way as PARTITION_EXPRESSION.
PARTITION_DESCRIPTION
TEXT
The value rules describing partitions for RANGE and LIST partitioning.
RANGE partitions: contain the values specified in the VALUES LESS THAN clause. The value can be an integer or MAXVALUE.
LIST partitions: contain the values defined in the VALUES IN clause, which is a comma-separated list of integer values.
Other partition types: For partitioning methods other than RANGE and LIST, the PARTITION_DESCRIPTION field is always NULL.
HIDDEN
ENUM
Explicit: user-explicitly created PARTITION policies.
Implicit: database-automatically created implicit PARTITION policies.
SE_PRIVATE_DATA
MEDIUMTEXT
Reserved fields.

Examples

tdsql> SELECT * FROM information_schema.partition_policy_partitions;
+---------------------+-----------------------+--------------+----------------+-------------------+----------------------------+-------------------------------+------------------+---------------------+----------------------+-------------------------+-----------------------+----------+---------------------------+
| PARTITION_POLICY_ID | PARTITION_POLICY_NAME | PARTITION_ID | PARTITION_NAME | SUBPARTITION_NAME | PARTITION_ORDINAL_POSITION | SUBPARTITION_ORDINAL_POSITION | PARTITION_METHOD | SUBPARTITION_METHOD | PARTITION_EXPRESSION | SUBPARTITION_EXPRESSION | PARTITION_DESCRIPTION | HIDDEN | SE_PRIVATE_DATA |
+---------------------+-----------------------+--------------+----------------+-------------------+----------------------------+-------------------------------+------------------+---------------------+----------------------+-------------------------+-----------------------+----------+---------------------------+
| 1 | impl_pp_hash_4 | 1 | p0 | NULL | 1 | NULL | HASH | NULL | INTEGER | NULL | NULL | Implicit | distribution_policy_id=0; |
| 1 | impl_pp_hash_4 | 2 | p1 | NULL | 2 | NULL | HASH | NULL | INTEGER | NULL | NULL | Implicit | distribution_policy_id=0; |
| 1 | impl_pp_hash_4 | 3 | p2 | NULL | 3 | NULL | HASH | NULL | INTEGER | NULL | NULL | Implicit | distribution_policy_id=0; |
| 1 | impl_pp_hash_4 | 4 | p3 | NULL | 4 | NULL | HASH | NULL | INTEGER | NULL | NULL | Implicit | distribution_policy_id=0; |
+---------------------+-----------------------+--------------+----------------+-------------------+----------------------------+-------------------------------+------------------+---------------------+----------------------+-------------------------+-----------------------+----------+---------------------------+
4 rows in set (0.02 sec)

Ajuda e Suporte

Esta página foi útil?

comentários