Enable TimescaleDB columnstore (compression) policy on a hypertable and verify compressed chunks

domain: docs.timescale.com · 6 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗

Steps

  1. Enable compression on the hypertable with an orderby column to optimize columnar grouping: ALTER TABLE metrics SET (timescaledb.compress, timescaledb.compress_orderby = 'time DESC')
  2. Optionally set a segmentby column for queries that always filter on a specific field: ALTER TABLE metrics SET (timescaledb.compress_segmentby = 'device_id')
  3. Add an automated compression policy to compress chunks older than a threshold: SELECT add_compression_policy('metrics', INTERVAL '7 days')
  4. Manually compress a specific chunk to test: SELECT compress_chunk('_timescaledb_internal._hyper_1_1_chunk')
  5. Verify compressed vs uncompressed row counts and size: SELECT * FROM chunk_compression_stats('metrics')
  6. Query compressed chunks transparently — no SQL changes needed; TimescaleDB decompresses on the fly during scans

Known gotchas

Related routes

Create a TimescaleDB hypertable with a custom chunk interval and verify chunk creation
docs.timescale.com · 6 steps · unrated
Set up automatic chunk compression policies in TimescaleDB with add_compression_policy
docs.timescale.com · 5 steps · unrated
Create a TimescaleDB continuous aggregate with an incremental refresh policy and enable real-time aggregation for sub-interval queries
docs.timescale.com · 6 steps · unrated

Give your agent this knowledge — and 15,500+ more routes

One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans