Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Filter push down #1397

Merged
merged 1 commit into from
Mar 23, 2023
Merged

Filter push down #1397

merged 1 commit into from
Mar 23, 2023

Conversation

andyfengHKU
Copy link
Contributor

This PR moves filter push down logic from join order enumerator to its own optimizer.

Current we push down for 3 cases

  • push down index equality predicate to scan and rewrite to index scan
  • push down index equality predicate to cross product and rewrite to index nested loop join
  • push down conjunctive filter before column scanning

This PR also adds heuristic filter reordering so that equality predicates are executed before non-equality predicates.

@codecov
Copy link

codecov bot commented Mar 21, 2023

Codecov Report

Patch coverage: 98.47% and project coverage change: -0.07 ⚠️

Comparison is base (d69f73e) 92.80% compared to head (3bc81d9) 92.74%.

❗ Current head 3bc81d9 differs from pull request most recent head bc29c74. Consider uploading reports for the commit bc29c74 to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1397      +/-   ##
==========================================
- Coverage   92.80%   92.74%   -0.07%     
==========================================
  Files         642      641       -1     
  Lines       22066    22067       +1     
==========================================
- Hits        20478    20465      -13     
- Misses       1588     1602      +14     
Impacted Files Coverage Δ
src/include/common/types/types.h 100.00% <ø> (ø)
src/include/planner/join_order_enumerator.h 100.00% <ø> (ø)
src/include/planner/query_planner.h 100.00% <ø> (ø)
src/planner/operator/logical_unwind.cpp 100.00% <ø> (ø)
src/optimizer/filter_push_down_optimizer.cpp 98.05% <98.05%> (ø)
src/include/binder/expression/expression.h 92.59% <100.00%> (ø)
src/include/optimizer/filter_push_down_optimizer.h 100.00% <100.00%> (ø)
src/optimizer/optimizer.cpp 100.00% <100.00%> (ø)
src/planner/join_order_enumerator.cpp 98.35% <100.00%> (+0.31%) ⬆️
src/planner/query_planner.cpp 94.49% <100.00%> (+0.16%) ⬆️
... and 1 more

... and 13 files with indirect coverage changes

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

src/planner/operator/logical_unwind.cpp Show resolved Hide resolved
test/optimizer/CMakeLists.txt Outdated Show resolved Hide resolved
test/optimizer/optimizer_test.cpp Show resolved Hide resolved
src/planner/subplans_table.cpp Show resolved Hide resolved
src/include/optimizer/filter_push_down_optimizer.h Outdated Show resolved Hide resolved
src/include/optimizer/filter_push_down_optimizer.h Outdated Show resolved Hide resolved
src/optimizer/filter_push_down_optimizer.cpp Show resolved Hide resolved
src/optimizer/filter_push_down_optimizer.cpp Outdated Show resolved Hide resolved
src/optimizer/filter_push_down_optimizer.cpp Outdated Show resolved Hide resolved
src/optimizer/filter_push_down_optimizer.cpp Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants