-
Notifications
You must be signed in to change notification settings - Fork 6k
planner: fix the wrong join estimation depending on missing or uninitialized stats #61604
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
Conversation
Hi @qw4990. Thanks for your PR. PRs from untrusted users cannot be marked as trusted with I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
/retest |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #61604 +/- ##
================================================
+ Coverage 73.1044% 73.8131% +0.7086%
================================================
Files 1729 1729
Lines 481039 484361 +3322
================================================
+ Hits 351661 357522 +5861
+ Misses 107839 105383 -2456
+ Partials 21539 21456 -83
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
/retest |
@qw4990: Cannot trigger testing until a trusted user reviews the PR and leaves an In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
@@ -472,7 +472,7 @@ func getGroupNDVs(ds *logicalop.DataSource) []property.GroupNDV { | |||
break | |||
} | |||
} | |||
if match { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If there is no stats in the cache which means that it will return false in here. So what is the behavior of this situation ?
/cc |
├─IndexRangeScan(Build) 10000.00 cop[tikv] table:t2, index:PRIMARY(a, b, c) range: decided by [eq(executor__index_lookup_merge_join.t2.a, executor__index_lookup_merge_join.t1.a) eq(executor__index_lookup_merge_join.t2.b, executor__index_lookup_merge_join.t1.b) eq(executor__index_lookup_merge_join.t2.c, executor__index_lookup_merge_join.t1.c)], keep order:false, stats:pseudo | ||
└─TableRowIDScan(Probe) 10000.00 cop[tikv] table:t2 keep order:false, stats:pseudo | ||
Sort 12500.00 root executor__index_lookup_merge_join.t1.a:desc | ||
└─HashJoin 12500.00 root left outer join, left side:TableReader, equal:[eq(executor__index_lookup_merge_join.t1.a, executor__index_lookup_merge_join.t2.a) eq(executor__index_lookup_merge_join.t1.c, executor__index_lookup_merge_join.t2.c) eq(executor__index_lookup_merge_join.t1.b, executor__index_lookup_merge_join.t2.b)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
12500
seems more reasonable, the prior 100000000.00
it not accurate.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
@@ -472,7 +472,7 @@ func getGroupNDVs(ds *logicalop.DataSource) []property.GroupNDV { | |||
break | |||
} | |||
} | |||
if match { | |||
if match && idx.IsEssentialStatsLoaded() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add some comments to explain why we need this extra check? Thanks!
/retest |
@qw4990: Cannot trigger testing until a trusted user reviews the PR and leaves an In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: AilinKid, hawkingrei The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
[LGTM Timeline notifier]Timeline:
|
Signed-off-by: ti-chi-bot <[email protected]>
In response to a cherrypick label: new pull request created to branch |
In response to a cherrypick label: new pull request created to branch |
Signed-off-by: ti-chi-bot <[email protected]>
Signed-off-by: ti-chi-bot <[email protected]>
In response to a cherrypick label: new pull request created to branch |
Signed-off-by: ti-chi-bot <[email protected]>
In response to a cherrypick label: new pull request created to branch |
In response to a cherrypick label: new pull request created to branch |
Signed-off-by: ti-chi-bot <[email protected]>
What problem does this PR solve?
Issue Number: close #61602
Problem Summary: planner: fix the wrong join estimation depending on missing or uninitialized stats
What changed and how does it work?
planner: fix the wrong join estimation depending on missing or uninitialized stats
It's hard to construct test cases for this issue since it depends on stats cache's status. So I tested it locally, and this PR can work for this scenario:
Check List
Tests
Side effects
Documentation
Release note
Please refer to Release Notes Language Style Guide to write a quality release note.