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

Adding a Partition to an Interval Partitioned Table

Partitions cannot be added to an interval partitioned table by running the ALTER TABLE ADD PARTITION command. If the data inserted by a user exceeds the range of the existing interval partitioned table, the database automatically creates a partition based on the INTERVAL value of the interval partitioned table.

For example, after the following data is inserted into the interval partitioned table interval_sales, the database creates a partition whose range is ['2020-07-01', '2020-08-01'). The new partition names start from sys_p1 in ascending order.

INSERT INTO interval_sales VALUES (263722,42819872,'2020-07-09','E',432072,213,17);