Help Center/
GaussDB/
Feature Guide(Centralized_8.x)/
Partitioned Table/
Partitioned Table O&M Management/
TRUNCATE PARTITION/
Clearing Level-2 Partitions from a Level-2 Partitioned Table
Updated on 2024-06-07 GMT+08:00
Clearing Level-2 Partitions from a Level-2 Partitioned Table
You can run ALTER TABLE TRUNCATE SUBPARTITION to clear a level-2 partition in a level-2 partitioned table.
For example, truncate the level-2 partition date_202005_channel1 in the level-2 partitioned table range_list_sales by specifying the partition name and update the global index.
ALTER TABLE range_list_sales TRUNCATE SUBPARTITION date_202005_channel1 UPDATE GLOBAL INDEX;
Alternatively, truncate a level-2 partition corresponding to the partition value ('2020-05-08', '0') in the level-2 partitioned table range_list_sales. Global indexes become invalid after this command is executed because the UPDATE GLOBAL INDEX clause is not used.
ALTER TABLE range_list_sales TRUNCATE SUBPARTITION FOR ('2020-05-08', '0');
Parent topic: TRUNCATE PARTITION
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