When Contiguous Hash Joins Pay Off in DuckDB and DataFusion

2026-11-25
Maxim Rusanov

TL;DR: An independent technical report on when faster hash-join probes offset the cost of reorganizing the build side.

Technical report Zenodo
Implementation DuckDB prototype and reproduction instructions
Dataset Benchmark observations and analysis scripts

Abstract

This independent study asks when scanning contiguous ranges of hash-join candidates repays the cost of constructing them. Paired single-thread SQL benchmarks compare experimental layouts with native execution in DuckDB 1.5.6 and Apache DataFusion 55.2.0. DuckDB's prototype copies staged build rows into contiguous buckets. Its policy improved aggregate performance on the tested SNAP graph queries, but stock DuckDB was faster overall on the Join Order Benchmark, LDBC BI, and TPC-DS. One Join Order Benchmark join reorganized 5.54 million build rows for three probe rows. DataFusion groups Arrow row IDs and saw lower aggregate query times on its tested SNAP and Join Order Benchmark workloads with automatic index selection. A break-even model relates these outcomes to build-side data movement, the frequency and locality of probes, and the cost of gathering payloads.