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

Cardinality est #1415

Merged
merged 1 commit into from
Mar 28, 2023
Merged

Cardinality est #1415

merged 1 commit into from
Mar 28, 2023

Conversation

andyfengHKU
Copy link
Contributor

This PR introduces basic cardinality estimator, for primary-foreign key join we simply use the following equation

|LEFT| * |RIGHT| / domain(primary key)

This equation should be widely applicable to joins between node and rel.

For predicate cardinality estimation we rely on magic numbers. All cardinality estimations are based on factorized tuples.

For cost model, we simply use the sum of all intermediate result size.

@codecov
Copy link

codecov bot commented Mar 28, 2023

Codecov Report

❗ No coverage uploaded for pull request base (master@98a3349). Click here to learn what that means.
Patch coverage: 100.00% of modified lines in pull request are covered.

❗ Current head 169aff7 differs from pull request most recent head 4792ec3. Consider uploading reports for the commit 4792ec3 to get more accurate results

Additional details and impacted files
@@            Coverage Diff            @@
##             master    #1415   +/-   ##
=========================================
  Coverage          ?   92.64%           
=========================================
  Files             ?      649           
  Lines             ?    22375           
  Branches          ?        0           
=========================================
  Hits              ?    20730           
  Misses            ?     1645           
  Partials          ?        0           
Impacted Files Coverage Δ
...include/planner/join_order/cardinality_estimator.h 100.00% <100.00%> (ø)
src/include/planner/join_order_enumerator.h 100.00% <100.00%> (ø)
...ude/planner/logical_plan/logical_operator/schema.h 100.00% <100.00%> (ø)
src/include/planner/logical_plan/logical_plan.h 100.00% <100.00%> (ø)
src/include/planner/query_planner.h 100.00% <100.00%> (ø)
src/include/planner/update_planner.h 100.00% <100.00%> (ø)
src/planner/join_order/cardinality_estimator.cpp 100.00% <100.00%> (ø)
src/planner/join_order/cost_model.cpp 100.00% <100.00%> (ø)
src/planner/join_order_enumerator.cpp 98.65% <100.00%> (ø)
src/planner/projection_planner.cpp 95.16% <100.00%> (ø)
... and 2 more

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/join_order/cardinality_estimator.cpp Outdated Show resolved Hide resolved
src/include/planner/join_order/cardinality_estimator.h Outdated Show resolved Hide resolved
@andyfengHKU andyfengHKU merged commit 0a882b3 into master Mar 28, 2023
@andyfengHKU andyfengHKU deleted the cardinality-est branch March 28, 2023 17:22
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