Post

It’s the memory latency, stupid

A database GROUP BY can get faster by doing more work: Pivot partitions keys by hash first, then aggregates each partition in a smaller cache-friendly hash table.

The article uses performance counters to explain stalls and DRAM traffic, and walks through the Rust implementation. In the discussion, an embedded developer described similar benefits from inline allocation and cache-conscious data structures, while another reader stressed backing such changes with measurements.