ALTER statement alone does not compress a . To do so, either create a compression policy
using the add_compression_policy function or manually compress a specific
using the compress_chunk function.
The syntax is:
Samples
Configure a that ingests device data to use compression. Here, if the is often queried about a specific device or set of devices, the compression should be segmented using thedevice_id for greater performance.
Arguments
| Name | Type | Default | Required | Description |
|---|---|---|---|---|
timescaledb.compress | BOOLEAN | - | ✔ | Enable or disable compression |
timescaledb.compress_orderby | TEXT | Descending order of the ‘s time column | - | Order used by compression, specified in the same way as the ORDER BY clause in a SELECT query. |
timescaledb.compress_segmentby | TEXT | No segment by columns | - | Column list on which to key the compressed segments. An identifier representing the source of the data such as device_id or tags_id is usually a good candidate. |
timescaledb.compress_chunk_time_interval | TEXT | - | - | EXPERIMENTAL: Set compressed time interval used to roll s into. This parameter compresses every , and then irreversibly merges it into a previous adjacent if possible, to reduce the total number of s in the . Note that s will not be split up during decompression. It should be set to a multiple of the current interval. This option can be changed independently of other compression settings and does not require the timescaledb.compress argument. |
Parameters
| Name | Type | Description |
|---|---|---|
table_name | TEXT | that supports compression |
column_name | TEXT | Column used to order by or segment by |
interval | TEXT | Time interval used to roll compressed s into |