Skip to content
This repository was archived by the owner on Apr 20, 2026. It is now read-only.

Latest commit

 

History

History
51 lines (37 loc) · 1.37 KB

File metadata and controls

51 lines (37 loc) · 1.37 KB
api_name set_number_partitions()
excerpt Set the number of hash partitions for a hypertable
topics
distributed hypertables
hypertables
keywords
hypertables
partitions
api
license type
community
function
seo
robots
noindex

import MultiNodeDeprecation from "versionContent/_partials/_multi-node-deprecation.mdx";

set_number_partitions() Community

Sets the number of partitions (slices) of a space dimension on a hypertable. The new partitioning only affects new chunks.

Required arguments

Name Type Description
hypertable REGCLASS Hypertable to update the number of partitions for.
number_partitions INTEGER The new number of partitions for the dimension. Must be greater than 0 and less than 32,768.

Optional arguments

Name Type Description
dimension_name REGCLASS 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 is 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');