Abstract
This paper challenges the long-standing assumption that partitioning data to fit into the CPU cache is always the best way to perform in-memory hash joins. By introducing a bandwidth-driven performance model, the authors demonstrate that on modern multi-core systems with high memory bandwidth, a simpler "no-partitioning" join often outperforms complex radix partitioning, especially as data "granularity" (tuple size) increases.
Introduction
Hash joins are fundamental operations in database systems. For years, Radix Partitioning was considered the gold standard for in-memory performance. The strategy involves dividing large tables into small pieces that fit within the CPU's Last-Level Cache (LLC), thereby avoiding high-latency main memory accesses.
However, modern hardware has evolved. Processors now feature massive memory bandwidth and advanced capabilities like software prefetching. This paper argues that the overhead of multi-pass partitioning—moving data multiple times just to organize it—may now outweigh the costs of the cache misses it seeks to prevent.
Methodology: A Bandwidth-Driven Model
The authors propose a performance model that views join operations as a competition between computation time ($T_{com}$) and memory access time ($T_{mem}$).
Granularity and Read/Write Amplification
A key innovation of this model is the inclusion of "granularity." When a 16-byte tuple is accessed, hardware typically moves an entire 64-byte or 128-byte cache line. This "read/write amplification" is a significant hidden cost in data movement often ignored in older models.
Overlap and Algorithms
The model assumes that optimized algorithms can overlap computation with memory access, making the total execution time the maximum of the two ($\\max(T_{com}, T_{mem})$). Two primary algorithms are compared:
- No-partitioning Hash Join: A parallel join where threads build and probe a shared hash table.
- Radix Partitioning Hash Join: A multi-pass approach that re-orders data into cache-sized partitions before joining.
Key Insights: When Granularity Matters
The study identifies a mathematical "break-even" point for tuple size ($W$). If the tuple size exceeds approximately 1/8th of the cache line size ($W \approx G/8$), the no-partitioning join typically becomes the more efficient choice. For a standard 64B cache line, this threshold is only 8 bytes.
Radix partitioning is inherently "data-hungry," requiring multiple passes over the data. While this optimizes cache usage, it places extreme pressure on memory bandwidth. As bandwidth increases, the random-access penalty of no-partitioning joins decreases relative to the multi-pass overhead of partitioning.
Key Results
Experiments were conducted on Intel Xeon and IBM POWER8 architectures using synthetic column-oriented workloads with tuple sizes ranging from 4B to 128B.
The Impact of Prefetching
Software prefetching is a critical factor. It allows the no-partitioning join to "hide" memory latency by fetching hash buckets before the CPU requires them. This effectively neutralizes the primary advantage of partitioning.
On the Intel machine, no-partitioning became the winner for tuples larger than 8B. On the POWER8, which features larger 128B cache lines, the no-partitioning join was even more dominant. Software prefetching improved no-partitioning performance by 25% on Intel and 35% on POWER8.
Conclusion
The research demonstrates that the complexity of radix partitioning is often unnecessary on modern hardware. As tuple sizes increase and memory bandwidth grows, the simpler no-partitioning join, augmented by software prefetching, provides superior performance. Future work will address data skew and multi-node NUMA effects to further refine the performance model.
Summary updated