Skip to content
Opensource internals
  • Posts

Aggregation

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 Estimates Distinct Counts by Thinning a Hash Table

Oct 21, 2026 22 min read Jay Hubbert

uniq() is a hash table that deliberately throws data away. When it fills up, it halves its sample rate, keeps the survivors, and multiplies the count back up by the…

ClickhouseInternalsAggregationProbabilisticHash table

Read more →

ClickHouse Splits GROUP BY into 256 Buckets for Parallel Merges

Oct 21, 2026 15 min read Jay Hubbert

A GROUP BY needs a serial merge at the end — and that’s where the memory high-water mark lives.

ClickhouseInternalsHash tableAggregationParallelism

Read more →

© 2026 Jay Hubbert · Built with Hugo 0.168.0

RSS ·