Skip to content
Opensource internals
  • Posts

Performance

How ClickHouse Stores Dictionaries in Sharded Hash Tables

Oct 22, 2026 17 min read Jay Hubbert

The hashed dictionary packs keys compactly, shards the table for parallel loading, and picks its hash table by measured memory footprint.

ClickhouseDictionariesInternalsMemoryPerformance

Read more →

How ClickHouse Writes the Native Format, Column at a Time

Oct 22, 2026 14 min read Jay Hubbert

The Native format writes a row count, then for each column its name, type, serialization kind and bulk data — never a row.

ClickhouseInternalsFormatsSerializationPerformance

Read more →

ClickHouse Aggregates In Order and Stops Reading Early

Oct 21, 2026 16 min read Jay Hubbert

If your table is sorted by the GROUP BY key, ClickHouse can skip the hash table entirely: it counts each contiguous run of equal keys and emits it.

ClickhouseInternalsAggregationPerformance

Read more →

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 Evaluates IN with Hash Sets: Build Once, Probe Once Per Row

Oct 21, 2026 21 min read Jay Hubbert

ClickHouse picks one of thirteen hash-table shapes for IN based on the key type, then spills the set to disk behind per-block Bloom filters when it outgrows RAM.

ClickhousePerformanceInternalsHash tableSet

Read more →

← Newer Page 8 of 16 Older →

© 2026 Jay Hubbert · Built with Hugo 0.168.0

RSS ·