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

Factorization aware dp #1384

Merged
merged 1 commit into from
Mar 20, 2023
Merged

Factorization aware dp #1384

merged 1 commit into from
Mar 20, 2023

Conversation

andyfengHKU
Copy link
Contributor

This PR changes the set of plans that kept in DP table during enumeration. Previous, we only keep plans with top K (K=50) lowest cost. This PR keeps plans with top 1 lowest cost for each different factorization structure.

The rationale is

Consider a triangle + an edge
MATCH (a)->(b)->(c), (a)->(c), (c)->(d)
First it make sense to close the cycle as early as possible, so (a)->(b)->(c), (a)->(c)  will be handled first with WCOJ. The output factorization structures
[a, b] * [c] , [b, c] * [a] , [a, c] * [b]  (where the second group is unFlat) are considered as homogeneous. So any one could be picked in the DP level 3 for subgraph `(a)->(b)->(c), (a)->(c)`
But then at the next level, there is a clear disadvantage for [a, b] * [c] because further extension undermines the factorization.

This PR also fixes issue #1098 and #1371

@codecov
Copy link

codecov bot commented Mar 17, 2023

Codecov Report

Patch coverage: 100.00% and project coverage change: +0.02 🎉

Comparison is base (8299c02) 92.76% compared to head (38abd23) 92.78%.

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

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1384      +/-   ##
==========================================
+ Coverage   92.76%   92.78%   +0.02%     
==========================================
  Files         641      641              
  Lines       22005    22085      +80     
==========================================
+ Hits        20412    20492      +80     
  Misses       1593     1593              
Impacted Files Coverage Δ
.../include/binder/query/reading_clause/query_graph.h 96.66% <ø> (ø)
src/include/common/types/types.h 100.00% <ø> (ø)
src/include/planner/logical_plan/logical_plan.h 100.00% <ø> (ø)
src/planner/join_order_enumerator.cpp 98.04% <ø> (-0.01%) ⬇️
src/binder/query/query_graph.cpp 96.29% <100.00%> (ø)
...ude/planner/logical_plan/logical_operator/schema.h 100.00% <100.00%> (ø)
src/include/planner/subplans_table.h 100.00% <100.00%> (ø)
src/planner/operator/schema.cpp 78.49% <100.00%> (+4.81%) ⬆️
src/planner/subplans_table.cpp 100.00% <100.00%> (ø)
src/processor/mapper/map_intersect.cpp 100.00% <100.00%> (ø)
... and 2 more

... and 27 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/binder/query/query_graph.cpp Outdated Show resolved Hide resolved
src/include/planner/logical_plan/logical_plan.h Outdated Show resolved Hide resolved
src/include/planner/subplans_table.h Outdated Show resolved Hide resolved
src/include/binder/query/reading_clause/query_graph.h Outdated Show resolved Hide resolved
src/include/binder/query/reading_clause/query_graph.h Outdated Show resolved Hide resolved
src/planner/operator/schema.cpp Show resolved Hide resolved
src/include/planner/subplans_table.h Show resolved Hide resolved
@andyfengHKU andyfengHKU merged commit ff3c503 into master Mar 20, 2023
@andyfengHKU andyfengHKU deleted the factorization-aware-dp branch March 20, 2023 04:18
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