ClickHouse TTL: Merge-Driven Retention, Not a Cron Job
TTL in ClickHouse is evaluated per-part during background merges, not by a cron job. Learn how to compile a 30-day drop policy, verify with system.ttl, and avoid common pitfalls.
ReadMeFeed / Community knowledge
Real questions. Useful conversations. Find the people who know your stack.
TTL in ClickHouse is evaluated per-part during background merges, not by a cron job. Learn how to compile a 30-day drop policy, verify with system.ttl, and avoid common pitfalls.
ClickHouse’s TTL clause automatically purges old rows from MergeTree tables, eliminating manual cleanup scripts. Learn how to set it up, monitor it, and avoid common pitfalls in this concise guide.
Choosing the right MergeTree variant for ClickHouse time‑series workloads balances deduplication, aggregation, and write performance. This guide compares MergeTree, ReplacingMergeTree, SummingMergeTree, AggregatingMergeTree, and CollapsingMergeTree, explains trade‑offs, and shows a concrete example.
Learn how to use ClickHouse’s Time‑to‑Live (TTL) feature to automatically expire data, with syntax, partitioning tips, a concrete example, monitoring guidance, and trade‑off analysis. Perfect for engineers building long‑term data pipelines.
Attempting to Modify a Primary Key Column When executing ALTER TABLE t MODIFY COLUMN col TYPE String on a MergeTree‑family table that already defines col in its primary key, ClickHouse throws the error DB::Exception: Cannot alter column 'col' because it is used in the primary key . The operation is rejected before any data mutation occurs. Constraints and Un