Skip to content
Opensource internals
  • Posts

Mergetree

ClickHouse Deletes Expired TTL Rows Only When Parts Merge

Oct 23, 2026 17 min read Jay Hubbert

ClickHouse stores a per-part TTL expiry bound and removes expired rows during a merge, using a bit mask rather than a rewrite.

ClickhouseInternalsMergetreeTtlPerformance

Read more →

How ClickHouse Picks a Projection to Read

Oct 23, 2026 14 min read Jay Hubbert

ClickHouse scores each projection by the marks it must read, including the parts it cannot serve, and picks the cheapest.

ClickhouseInternalsMergetreeProjectionsQuery planning

Read more →

How ClickHouse Recompresses a Part When Its TTL Expires

Oct 23, 2026 13 min read Jay Hubbert

A RECOMPRESS TTL rewrites a whole part with a new codec once all of its rows have expired.

ClickhouseInternalsMergetreeTtlCompression

Read more →

How SummingMergeTree and AggregatingMergeTree Merge Rows

Oct 23, 2026 12 min read Jay Hubbert

SummingMergeTree and AggregatingMergeTree combine rows inside the merge algorithm, group by group, as the sorted streams are walked.

ClickhouseInternalsMergetreeAggregatingmergetreeSummingmergetree

Read more →

ClickHouse Makes a MergeTree Part Visible with One Directory Rename

Oct 22, 2026 12 min read Jay Hubbert

A MergeTree part is written to a temp directory through a stack of write buffers and published by one atomic directory rename.

ClickhouseInternalsMergetreeDurabilityPerformance

Read more →

← Newer Page 1 of 2 Older →

© 2026 Jay Hubbert · Built with Hugo 0.168.0

RSS ·