tencent cloud

TDSQL Boundless

PARTITION_POLICIES

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

Function

INFORMATION_SCHEMA.PARTITION_POLICIES 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.

Field Description

Field Name
Type
Description
ID
BIGINT UNSIGNED
Each PARTITION POLICY has a unique ID.
NAME
VARCHAR(64)
Each PARTITION POLICY has a unique NAME.
PARTITION_TYPE
ENUM
Partition type, supports the following
HASH: Partitions data based on the hash-function results of given columns.
KEY_51: Similar to the HASH method, but allows specifying multiple columns. The data kernel calculates the hash-function results of these columns for partitioning.
KEY_55: Similar to KEY_51, but KEY_51 and KEY_55 differ in the hash algorithms used internally.
LINEAR_HASH: Linear hash partitioning, similar to HASH, but employs a linear hash algorithm, resulting in a more even data distribution.
LINEAR_KEY_51: Similar to KEY_51, but employs a linear hash algorithm.
LINEAR_KEY_55: Similar to KEY_55, but employs a linear hash algorithm.
RANGE: Partitions data based on the range of given columns. Each partition contains data within a specific range.
LIST: Partitions data based on a list of discrete values for given columns.
RANGE_COLUMNS: Similar to RANGE partitioning, but allows partitioning based on the range of multiple columns.
LIST_COLUMNS: Similar to LIST partitioning, but allows partitioning based on a list of discrete values for multiple columns.
AUTO: Automatic partition type. The system automatically selects an appropriate partitioning policy based on the characteristics of the data.
AUTO_LINEAR: Automatic linear partition type. The system automatically selects an appropriate linear partition policy based on the characteristics of the data.
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_TYPE
ENUM
Subpartition type, supports the following
HASH
KEY_51
KEY_55
LINEAR_HASH
LINEAR_KEY_51
LINEAR_KEY_55
SUBPARTITION_EXPRESSION
VARCHAR(2048)
Subpartition expression, defined in the same way as PARTITION_EXPRESSION.
HIDDEN
ENUM('Explicit', 'Implicit')
Explicitly created PARTITION POLICY by users or implicitly created PARTITION POLICY automatically generated by the database.
SE_PRIVATE_DATA
MEDIUMTEXT
Reserved fields.

Examples

tdsql> SELECT * FROM information_schema.partition_policies;
+----+----------------+----------------+----------------------+-------------------+-------------------------+----------+-----------------+
| ID | NAME | PARTITION_TYPE | PARTITION_EXPRESSION | SUBPARTITION_TYPE | SUBPARTITION_EXPRESSION | HIDDEN | SE_PRIVATE_DATA |
+----+----------------+----------------+----------------------+-------------------+-------------------------+----------+-----------------+
| 1 | impl_pp_hash_4 | HASH | INTEGER | NULL | NULL | Implicit | NULL |
+----+----------------+----------------+----------------------+-------------------+-------------------------+----------+-----------------+
1 row in set (0.01 sec)

Ajuda e Suporte

Esta página foi útil?

comentários