CREATE PARTITION min max
Create one or more partitions from min
to max
inclusive interval.
Typically, there is no need to use this command since partitions are created automatically on write. However, this command can manually create partitions of different intervals rather than using one set globally.
If overlapping partitions exist, this command will create two or more partitions to fill the gap between the minimum and maximum range.
Partitions will be created empty without corresponding partition files or WAL records. They will not be recreated on restart unless explicitly written by the REFRESH command.
Global partition interval #
It is possible to change global partition interval using SET
command:
SET interval TO 10000
Examples #
CREATE PARTITION 0 10000
SHOW PARTITIONS
[{
"min": 0,
"max": 10000,
"events": 0,
"events_heap": 0,
"regions": 0,
"size": 0,
"size_uncompressed": 0,
"size_heap": 0,
"created": 1712235990007596,
"refreshed": 0,
"refreshes": 0,
"on_storage": false,
"on_cloud": false,
"storage": "main"
}]
See also SHOW PARTITIONS, DROP PARTITIONS, MOVE PARTITIONS, CREATE STORAGE