Help Center/ GaussDB/ Centralized_8.x/ Partitioned Table/ Partitioned Table O&M Management/ MERGE PARTITION/ Merging Level-2 Partitions for a Level-2 Partitioned Table
Updated on 2024-06-07 GMT+08:00

Merging Level-2 Partitions for a Level-2 Partitioned Table

You can run ALTER TABLE MERGE SUBPARTITIONS to merge multiple level-2 partitions into one level-2 partition.

For example, merge the level-2 partitions product1_channel1, product1_channel2 and product1_channel3 of the level-2 partitioned table hash_list_sales into a new level-2 partition and update the global index.
ALTER TABLE hash_list_sales MERGE SUBPARTITIONS product1_channel1, product1_channel2, product1_channel3 INTO
    SUBPARTITION product1_channel1 UPDATE GLOBAL INDEX;