Enable a compression policy
This page uses an example table, calledexample, and segments it by the device_id column. Every chunk that is more
than seven days old is then marked to be automatically compressed. The source data is organized like this:
-
Alter the table
At the
psqlprompt, alter the table: -
Add a compression policy
Add a compression policy to compress chunks that are older than seven days:
ALTER TABLE (compression) and
add_compression_policy.
View current compression policy
To view the compression policy that you’ve set:timescaledb_information.jobs.
Pause compression policy
To disable a compression policy temporarily, find the corresponding job ID and then callalter_job to pause it:
Remove compression policy
To remove a compression policy, useremove_compression_policy:
remove_compression_policy.