Help Center/
GaussDB/
Feature Guide(Centralized_8.x)/
Partitioned Table/
Automatic Partitioning/
Enabling/Disabling Automatic Partitioning/
Enabling/Disabling Automatic Level-2 List Partitioning
Updated on 2024-06-07 GMT+08:00
Enabling/Disabling Automatic Level-2 List Partitioning
You can run ALTER TABLE SET SUBPARTITIONING to enable or disable automatic level-2 list partitioning.
Examples:
- Enable automatic partitioning of level-2 list partitioned tables.
gaussdb=# CREATE TABLE range_list (c1 int, c2 int) PARTITION BY RANGE (c1) SUBPARTITION BY LIST (c2) ( PARTITION p1 VALUES LESS THAN (5) ( SUBPARTITION sp11 VALUES (1, 2, 3), SUBPARTITION sp12 VALUES (4, 5, 6) ), PARTITION p2 VALUES LESS THAN (10) ( SUBPARTITION sp21 VALUES (1, 2, 3), SUBPARTITION sp22 VALUES (4, 5, 6) ) ); gaussdb=# ALTER TABLE range_list SET SUBPARTITIONING AUTOMATIC;
To enable automatic level-2 list partitioning, ensure that no DEFAULT partition key exists in level-2 partitions.
- Disable automatic partitioning of level-2 list partitioned tables.
gaussdb=# ALTER TABLE range_list SET SUBPARTITIONING MANUAL; -- Cleanup example gaussdb=# DROP TABLE range_list;
Parent topic: Enabling/Disabling Automatic Partitioning
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
The system is busy. Please try again later.
For any further questions, feel free to contact us through the chatbot.
Chatbot