cloudberry icon indicating copy to clipboard operation
cloudberry copied to clipboard

Push the runtime filter from hashjoin to seqscan or AM.

Open zhangyue-hashdata opened this issue 1 year ago • 1 comments

Change logs If gp_enable_runtime_filter_pushdown is on, something will run during query:

  1. In ExecInitHashJoin(), try to find the direct mapper between var in hashclauses and var in seqscan. If found we will save the mapper in AttrFilter and all AttrFilters will be pushed to hash node.
  2. During building hash table we will create the range/bloom filters in AttrFilter. These filters will be converted to the list of ScanKey and pushed to Seqscan once completed.
  3. If AM support SCAN_SUPPORT_RUNTIME_FILTER, these ScanKeys will be pushed down to the AM module further, otherwise will be used to filter slot in Seqscan;

Why are the changes needed? The commit may improve the performance of query including hashjoin.

Does this PR introduce any user-facing change? No.

How was this patch tested? Yes, add test cases in src/test/regress/sql/gp_runtime_filter.sql

Contributor's Checklist Here are some reminders and checklists before/when submitting your pull request, please check them:

  • [ ] Make sure your Pull Request has a clear title and commit message. You can take git-commit template as a reference.
  • [ ] Sign the Contributor License Agreement as prompted for your first-time contribution(One-time setup).
  • [ ] Learn the coding contribution guide, including our code conventions, workflow and more.
  • [ ] List your communication in the GitHub Issues or Discussions (if has or needed).
  • [ ] Document changes.
  • [ ] Add tests for the change
  • [ ] Pass make installcheck
  • [ ] Pass make -C src/test installcheck-cbdb-parallel
  • [ ] Feel free to request cloudberrydb/dev team for review and approval when your PR is ready🥳

zhangyue-hashdata avatar Apr 10 '24 04:04 zhangyue-hashdata

CLA assistant check
All committers have signed the CLA.

CLAassistant avatar Apr 10 '24 04:04 CLAassistant

Close the PR since no response for a long time.

my-ship-it avatar Aug 26 '24 06:08 my-ship-it