mbutrovich opened a new pull request, #13147:
URL: https://github.com/apache/datafusion/pull/13147
## Which issue does this PR close?
<!--
We generally require a GitHub issue to be filed for all bug fixes and
enhancements and this helps us generate change logs for our releases. You can
link an issue to this PR using the GitHub syntax. For example `Closes #123`
indicates that this PR will close issue #123.
-->
Closes #.
## Rationale for this change
<!--
Why are you proposing this change? If this is already explained clearly in
the issue then this section is not needed.
Explaining clearly why changes are proposed helps reviewers understand your
changes and offer better suggestions for fixes.
-->
Research literature describes how bloom filters can be a nice filter to
probe before performing a (possibly) more expensive hash table lookup. I see
larger changes like SIP #13054, but this is a much more naïve idea.
## What changes are included in this PR?
<!--
There is no need to duplicate the description in the issue here but it is
sometimes worth providing a summary of the individual changes in this PR.
-->
Use [fastbloom](https://github.com/tomtomwombat/fastbloom) in hash join
executor to build a filter on the build side, then during probe check the bloom
filter first. Bloom filter is not tuned for size yet (fixed to 8192 bytes,
which may not be ideal) or number of hash functions, and my Rust is still
pretty rudimentary.
## Are these changes tested?
<!--
We typically require tests for all PRs in order to:
1. Prevent the code from being accidentally broken by subsequent changes
2. Serve as another way to document the expected behavior of the code
If tests are not included in your PR, please explain why (for example, are
they covered by existing tests)?
-->
Existing hash join tests. I ran TPC-H locally.
```
┏━━━━━━━━━━━━━━┳━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━┓
┃ Query ┃ main ┃ hash_join_bloom ┃ Change ┃
┡━━━━━━━━━━━━━━╇━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━┩
│ QQuery 1 │ 453.68ms │ 452.63ms │ no change │
│ QQuery 2 │ 231.48ms │ 121.17ms │ +1.91x faster │
│ QQuery 3 │ 326.84ms │ 270.62ms │ +1.21x faster │
│ QQuery 4 │ 173.86ms │ 131.48ms │ +1.32x faster │
│ QQuery 5 │ 525.63ms │ 387.44ms │ +1.36x faster │
│ QQuery 6 │ 86.38ms │ 83.44ms │ no change │
│ QQuery 7 │ 881.36ms │ 586.27ms │ +1.50x faster │
│ QQuery 8 │ 524.15ms │ 449.34ms │ +1.17x faster │
│ QQuery 9 │ 865.91ms │ 690.59ms │ +1.25x faster │
│ QQuery 10 │ 474.84ms │ 431.17ms │ +1.10x faster │
│ QQuery 11 │ 254.10ms │ 79.87ms │ +3.18x faster │
│ QQuery 12 │ 241.61ms │ 233.11ms │ no change │
│ QQuery 13 │ 426.25ms │ 244.56ms │ +1.74x faster │
│ QQuery 14 │ 179.60ms │ 150.92ms │ +1.19x faster │
│ QQuery 15 │ 244.86ms │ 231.98ms │ +1.06x faster │
│ QQuery 16 │ 92.51ms │ 79.54ms │ +1.16x faster │
│ QQuery 17 │ 700.88ms │ 640.57ms │ +1.09x faster │
│ QQuery 18 │ 1358.92ms │ 962.73ms │ +1.41x faster │
│ QQuery 19 │ 302.72ms │ 307.05ms │ no change │
│ QQuery 20 │ 286.99ms │ 276.42ms │ no change │
│ QQuery 21 │ 1263.95ms │ 819.43ms │ +1.54x faster │
│ QQuery 22 │ 116.23ms │ 90.06ms │ +1.29x faster │
└──────────────┴───────────┴─────────────────┴───────────────┘
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━┓
┃ Benchmark Summary ┃ ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━┩
│ Total Time (main) │ 10012.75ms │
│ Total Time (hash_join_bloom) │ 7720.40ms │
│ Average Time (main) │ 455.12ms │
│ Average Time (hash_join_bloom) │ 350.93ms │
│ Queries Faster │ 17 │
│ Queries Slower │ 0 │
│ Queries with No Change │ 5 │
└────────────────────────────────┴────────────┘
```
## Are there any user-facing changes?
<!--
If there are user-facing changes then we may require documentation to be
updated before approving the PR.
-->
<!--
If there are any breaking changes to public APIs, please add the `api
change` label.
-->
No.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]