Updated on 2024-06-07 GMT+08:00

MERGE PARTITION

You can run this command to merge multiple partitions into one partition. Partitions can be merged only by specifying partition names, instead of partition values.

  • This command cannot be applied to hash partitions.
  • Running this command will invalidate the global index. You can use the UPDATE GLOBAL INDEX clause to update the global index synchronously or rebuild the global index.
  • If any partition before combination contains a sparsely partitioned index, the partition cannot be combined.

For a range or interval partition, the name of the new partition can be the same as that of the last source partition. For example, partitions p1 and p2 can be merged into p2. For a list partition, the name of the new partition can be the same as that of any source partition. For example, p1 and p2 can be merged into p1.

If the name of the new partition is the same as that of the source partition, the database considers the new partition as inheritance of the source partition, which affects the query of the source partition during the merging. For details, see DQL/DML-DDL Concurrency.