Skip to content
Opensource internals
  • Posts

Performance

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 →

ClickHouse JIT-Compiles Scalar Expressions with LLVM

Oct 21, 2026 17 min read Jay Hubbert

ClickHouse compiles hot scalar expressions to native code with LLVM.

ClickhousePerformanceInternalsJitLlvm

Read more →

ClickHouse Marks Empty Hash Table Cells With Zeroed Memory

Oct 21, 2026 24 min read Jay Hubbert

ClickHouse’s hash table has no occupancy bit, no tombstone, and no sentinel pointer.

ClickhouseInternalsHash tablePerformanceMemory

Read more →

← Newer Page 6 of 13 Older →

© 2026 Jay Hubbert · Built with Hugo 0.168.0

RSS ·