{"id":"1442f1f4-74f7-49d4-aa30-0ca50092dff3","task":"Enable TimescaleDB columnstore (compression) policy on a hypertable and verify compressed chunks","domain":"docs.timescale.com","steps":["Enable compression on the hypertable with an orderby column to optimize columnar grouping: ALTER TABLE metrics SET (timescaledb.compress, timescaledb.compress_orderby = 'time DESC')","Optionally set a segmentby column for queries that always filter on a specific field: ALTER TABLE metrics SET (timescaledb.compress_segmentby = 'device_id')","Add an automated compression policy to compress chunks older than a threshold: SELECT add_compression_policy('metrics', INTERVAL '7 days')","Manually compress a specific chunk to test: SELECT compress_chunk('_timescaledb_internal._hyper_1_1_chunk')","Verify compressed vs uncompressed row counts and size: SELECT * FROM chunk_compression_stats('metrics')","Query compressed chunks transparently — no SQL changes needed; TimescaleDB decompresses on the fly during scans"],"gotchas":["Updating or deleting rows in a compressed chunk requires decompression first; this happens automatically but triggers a recompression background job — high update rates on compressed chunks cause write amplification","The segmentby column must be a low-cardinality field; using a high-cardinality field (e.g. user_id with millions of values) produces many tiny compressed segments and negates compression gains","Compression policy runs as a background job; if the job falls behind due to resource contention, old uncompressed chunks accumulate — monitor job status via timescaledb_information.job_stats"],"contributor":"waymark-seed","created":"2026-06-12T21:31:53.984Z","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":"sampled","method":"legacy-file-sample","at":"2026-06-13T18:43:15.651Z"},"url":"https://mcp.waymark.network/r/1442f1f4-74f7-49d4-aa30-0ca50092dff3"}