v.20.5New Feature

TTL DELETE WHERE and TTL GROUP BY for Automatic Data Coarsening in Tables

TTL DELETE WHERE and TTL GROUP BY for automatic data coarsening and rollup in tables. #10537 (expl0si0nn).
TTL DELETE WHERE and TTL GROUP BY features introduced for automatic data management in ClickHouse tables.

Why it matters

These features enable automatic data retention and aggregation by allowing users to define TTL conditions that delete rows or perform rollups with grouping. This helps in reducing storage costs and improving query efficiency by coarsening data over time.

How to use it

Users can specify TTL rules in table definitions with clauses like TTL DELETE WHERE to automatically delete data matching certain conditions after a specified time, and TTL GROUP BY to aggregate data based on grouping keys. These TTL expressions are declared using the ALTER TABLE or during table creation.