set_number_partitions()
Sets the number of partitions (slices) of a space dimension on a hypertable. The new partitioning only affects new chunks.
Required Arguments
Name | Description |
---|---|
hypertable | (REGCLASS) Hypertable to update the number of partitions for. |
number_partitions | The new number of partitions for the dimension. Must be greater than 0 and less than 32,768. |
Optional Arguments
Name | Description |
---|---|
dimension_name | The name of the space dimension to set the number of partitions for. |
The dimension_name
needs to be explicitly specified only if the hypertable has more than one space dimension. An error will be thrown otherwise.
Sample Usage
For a table with a single space dimension:
SELECT set_number_partitions('conditions', 2);
For a table with more than one space dimension:
SELECT set_number_partitions('conditions', 2, 'device_id');
当前内容版权归 TimescaleDB 或其关联方所有,如需对内容或内容相关联开源项目进行关注与资助,请访问 TimescaleDB .