Skip to content
Opensource internals
  • Posts

Performance

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 Packs Short Strings Into Hash Table Keys: No Allocation Per Key

Oct 21, 2026 14 min read Jay Hubbert

ClickHouse never stores a std::string in a hash table cell. It splits keys into size classes and packs strings of up to 24 bytes into plain integers, so your GROUP BY…

ClickhouseInternalsHash tableStringsPerformance

Read more →

ClickHouse Plans Distributed Queries with Cascades: A Real Cost-Based Optimizer

Oct 21, 2026 22 min read Jay Hubbert

ClickHouse’s new Cascades optimizer treats a distributed query as a search problem.

ClickhousePerformanceInternalsQuery planningDistributed

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 Sorts in Parallel: Partial Sort, Merge Sorted Streams and External Sort

Oct 21, 2026 17 min read Jay Hubbert

ClickHouse never sorts the whole dataset at once. It sorts each chunk, throws away rows that can’t make the top-N, merges the sorted streams, and spills runs to disk when…

ClickhouseInternalsSortingPerformance

Read more →

← Newer Page 7 of 13 Older →

© 2026 Jay Hubbert · Built with Hugo 0.168.0

RSS ·