Skip to content
Opensource internals
  • Posts

Storage engine

ClickHouse Decides Which Parts to Merge: A Cost Model for Write Amplification

Oct 21, 2026 20 min read Jay Hubbert

ClickHouse picks merge candidates with a tiny, explicit cost model: score each contiguous range as sum_size / (count - 1.9), pick the cheapest admissible one, and only ever…

ClickhousePerformanceInternalsMerge treeStorage engineBackground jobs

Read more →

ClickHouse Merges Columns One at a Time: The Vertical Merge Algorithm

Oct 21, 2026 20 min read Jay Hubbert

ClickHouse’s vertical merge splits a merge into two stages: merge the key and record where each output row came from (one byte per row), then gather each payload column…

ClickhousePerformanceInternalsMerge treeStorage engine

Read more →

ClickHouse Skips Data: Granules, Marks, and Bit-Packed Indexes

Oct 21, 2026 23 min read Jay Hubbert

A MergeTree scan isn’t a full scan. Parts are cut into granules, each granule gets a bit-packed mark, and the primary key index stores one key value per granule — so…

ClickhousePerformanceInternalsMerge treeStorage engineIndexes

Read more →

ClickHouse's Query Condition Cache: Skip Granules You Don't Need to Read

Oct 21, 2026 13 min read Jay Hubbert

ClickHouse caches the granules a predicate emptied, so a dashboard that runs the same query every 30 seconds stops paying for index analysis and skipped data.

ClickhousePerformanceInternalsMerge treeStorage engineCaching

Read more →

© 2026 Jay Hubbert · Built with Hugo 0.168.0

RSS ·