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

NameTypeDescription
hypertableREGCLASSHypertable to update the number of partitions for.
number_partitionsINTEGERThe new number of partitions for the dimension. Must be greater than 0 and less than 32,768.

Optional arguments

NameTypeDescription
dimension_nameREGCLASSThe 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 is thrown otherwise.

Sample usage

For a table with a single space dimension:

  1. SELECT set_number_partitions('conditions', 2);

For a table with more than one space dimension:

  1. SELECT set_number_partitions('conditions', 2, 'device_id');