A hash aggregation gets faster by waiting less for memory
Pivot reports a Rust aggregation experiment where partitioning data before grouping improved a warm single-core run from about 3.6 to 2.7 seconds. The extra pass creates smaller hash tables that fit better in cache. Hardware counters showed less waiting for memory, illustrating why a busy CPU can still spend much of its time stalled.
Pivot · Maor Kern · Oct 28, 2026
Why it matters
Measure memory stalls and cache behavior before assuming that fewer instructions will make a data-processing loop faster.
More context
The example groups 99 million ClickBench rows into roughly 17 million keys on an AMD EPYC 9124. It splits input into 4,096 partitions, then aggregates each separately. The article explains the counters and distinguishes this example from further optimizations in Pivot.
Keep in mind
These are vendor-reported measurements of a particular workload and machine. The warm-run timings are not a general database comparison or a guarantee that partitioning helps every dataset.
Original read