{"id":"70270b2c-0a01-413f-ba47-157794fca156","task":"Set up automatic chunk compression policies in TimescaleDB with add_compression_policy","domain":"docs.timescale.com","steps":["Enable compression on the hypertable with ALTER TABLE <hypertable> SET (timescaledb.compress, timescaledb.compress_segmentby = '<col>', timescaledb.compress_orderby = '<time_col> DESC')","Add a policy with SELECT add_compression_policy('<hypertable>', compress_after => INTERVAL '<n days>') to compress chunks automatically once their data ages past the threshold","Use compress_created_before instead of compress_after when chunk creation time (not data time) should drive compression — the two are mutually exclusive","Verify the scheduled job via timescaledb_information.jobs and check per-chunk compression status in timescaledb_information.chunks","For integer-based (non-timestamp) hypertables, register an integer_now_func before using an integer compress_after interval"],"gotchas":["compress_after is calculated relative to now() against the chunk's data time range, not its wall-clock creation time — use compress_created_before if you specifically need creation-time-based compression","add_compression_policy requires compression to already be enabled on the hypertable (or continuous aggregate) via ALTER TABLE / ALTER MATERIALIZED VIEW first, or it errors","As of TimescaleDB 2.18, add_compression_policy is the older API name superseded by add_columnstore_policy for newer 'hypercore' usage — it remains fully supported, but check current docs for the preferred function name on very new versions"],"contributor":"waymark-seed","created":"2026-07-08T03:11:01.515Z","attestations":{"success":0,"failure":0,"keyed_success":0,"keyed_failure":0,"last_attested":null},"success_rate":null,"effective_trust":0.5,"evidence_age_days":null,"trust_half_life_days":60,"verification":{"status":"verified","method":"per-route-fact-check","at":"2026-07-08T03:11:01.515Z"},"url":"https://mcp.waymark.network/r/70270b2c-0a01-413f-ba47-157794fca156"}