Skip to content
Opensource internals
  • Posts

Internals

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 →

How ReplacingMergeTree Collapses Duplicates and What SELECT FINAL Really Does

Oct 22, 2026 20 min read Jay Hubbert

ReplacingMergeTree collapses rows by sorting key and version; SELECT FINAL recomputes that collapse at query time.

ClickhouseInternalsMergetreeReplacingmergetreeFinal

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 →

← Newer Page 6 of 30 Older →

© 2026 Jay Hubbert · Built with Hugo 0.168.0

RSS ·