apache / apache/datafusion

Improve the hash join performance by replacing the RawTable to a hash table that supports prefetching

Open
#6,910 7 comments 0 reactions 0 assignees View on GitHub
enhancement performance
Dominant language
Rust
Stars
9.3k
Forks
2.4k
Avg merge
3d 7h
Merged PRs (30d)
344

Description

### Is your feature request related to a problem or challenge?

When testing the TPCH q17 on my PC, based on #6800, it costs around 2.4s. Among them, it costs around 800ms for constructing the `RawTable` of `JoinHashMap`.

To only find the hash location, the structure, `RawTable`, we used is too complex and the overhead is too heavy.

### Describe the solution you'd like

We can simple use a fixed size of vector with a hash mask to look up the hash location.

After applying the replacement, it only cost less than 100ms for the construction of `JoinHashMap`. And the overall time cost for the q17 is reduced from 2.4s to 1.8s.

### Describe alternatives you've considered

_No response_

### Additional context

_No response_

Contributor guide

Open the contributing guide

Research direction

Start by tracing JoinHashMap construction and its RawTable usage, using the TPCH q17 case and issue #6800 as context. Compare the current hash-location lookup with the proposed fixed-size vector and hash mask approach. Done means the replacement supports prefetching and improves JoinHashMap construction and overall q17 timings as described.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
databases, performance
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.