Samples
First convert tableconditions to with just time
partitioning on column time, then add an additional partition key on location with four partitions:
conditions to with time partitioning on time and
space partitioning (2 partitions) on location, then add two additional dimensions.
conditions to
a distributed with just time partitioning on column time,
and finally add a space partitioning dimension on location
with two partitions (as the number of the attached data nodes).
Parallelizing queries across multiple data nodes
In a distributed , space partitioning enables inserts to be parallelized across data nodes, even while the inserted rows share timestamps from the same time interval, and thus increases the ingest rate. Query performance also benefits by being able to parallelize queries across nodes, particularly when full or partial aggregations can be “pushed down” to data nodes (for example, as in the queryavg(temperature) FROM conditions GROUP BY hour, location
when using location as a space partition).
Parallelizing disk I/O on a single node
Parallel I/O can benefit in two scenarios: (a) two or more concurrent queries should be able to read from different disks in parallel, or (b) a single query should be able to use query parallelization to read from multiple disks in parallel. Thus, users looking for parallel I/O have two options:- Use a RAID setup across multiple physical disks, and expose a single logical disk to the (that is, via a single tablespace).
- For each physical disk, add a separate tablespace to the database. allows you to actually add multiple tablespaces to a single (although under the covers, a ‘s s are spread across the tablespaces associated with that ).
Arguments
The syntax is:Returns
On failure, an error is returned:
When executing this function, either
number_partitions or
chunk_time_interval must be supplied, which dictates if the
dimension uses hash or interval partitioning.
The chunk_time_interval should be specified as follows:
- If the column to be partitioned is a TIMESTAMP, TIMESTAMPTZ, or DATE, this length should be specified either as an INTERVAL type or an integer value in microseconds.
-
If the column is some other integer type, this length
should be an integer that reflects
the column’s underlying semantics (for example, the
chunk_time_intervalshould be given in milliseconds if this column is the number of milliseconds since the UNIX epoch).