v.18.4Improvement

ALTER TABLE t DELETE WHERE Query Behavior in ClickHouse

The ALTER TABLE t DELETE WHERE query does not rewrite data parts that were not affected by the WHERE condition #2694.
The ALTER TABLE t DELETE WHERE query is optimized to rewrite only the data parts affected by the WHERE condition, skipping unaffected parts.

Why it matters

This feature improves the efficiency of the ALTER TABLE ... DELETE WHERE operation by avoiding unnecessary rewriting of data parts that do not meet the WHERE condition. It reduces I/O and speeds up deletion queries, benefiting users with large datasets.

How to use it

Users can simply execute the ALTER TABLE t DELETE WHERE <condition> query as usual. The optimization works automatically without requiring additional configuration.