How ClickHouse Recompresses a Part When Its TTL Expires
A RECOMPRESS TTL rewrites a whole part with a new codec once all of its rows have expired.
A RECOMPRESS TTL rewrites a whole part with a new codec once all of its rows have expired.
SummingMergeTree and AggregatingMergeTree combine rows inside the merge algorithm, group by group, as the sorted streams are walked.
A MergeTree part is written to a temp directory through a stack of write buffers and published by one atomic directory rename.
ClickHouse places parts with a three-level reserve ladder: policy → volume → disk, with per-volume part-size limits and TTL-driven moves.
ReplacingMergeTree collapses rows by sorting key and version; SELECT FINAL recomputes that collapse at query time.