-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
planner: consider seek cost of probe-side for index join #33867
Merged
Merged
Changes from 42 commits
Commits
Show all changes
44 commits
Select commit
Hold shift + click to select a range
029b606
fixup
qw4990 b877ec4
fixup
qw4990 c070de8
fixup
qw4990 7f25f11
fixup
qw4990 4a908e0
fixup
qw4990 15f50f8
fixup
qw4990 7fe50d7
fixup
qw4990 a9d7b0d
fixup
qw4990 36d8bc0
fixup
qw4990 21cb413
fixup
qw4990 9d2b421
fixup
qw4990 2257464
fixup
qw4990 c2701d1
fixup
qw4990 8fa5cba
fixup
qw4990 c2bb472
fixup
qw4990 a74991f
fixup
qw4990 415b85d
fixup
qw4990 28c9163
fixup
qw4990 0f01ca9
Merge branch 'master' into fix-33844
qw4990 30915b0
fixup
qw4990 0c17da2
fixup
qw4990 be938b3
fixup
qw4990 88cdfd7
Merge branch 'master' into fix-33844
qw4990 99647ac
fixup
qw4990 273db42
Merge branch 'master' into fix-33844
qw4990 1b3cc1f
Merge branch 'master' into fix-33844
qw4990 8ab3a9c
Merge branch 'master' into fix-32362
qw4990 39ffc86
fixup
qw4990 d52dea4
Merge remote-tracking branch 'upstream/master' into fix-32362
qw4990 26eec5a
fix ci
qw4990 5bb3978
fix ci
qw4990 c6d0cf0
fix ci
qw4990 925200b
fix ci
qw4990 a817a1f
fix ci
qw4990 7534ae4
fix ci
qw4990 2e841bd
fix ci
qw4990 6a821e5
fix ci
qw4990 80abc1c
fix ci
qw4990 facd4aa
fix ci
qw4990 21c0333
fix ci
qw4990 8912d3d
Merge branch 'master' into fix-32362
qw4990 81b3197
fix ci
qw4990 43c8242
Merge branch 'master' into fix-32362
qw4990 ee75dc8
fixup
qw4990 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
We change
ranges
here. Besides calculating seek cost of probe-side, it also affects the calculation of other costs since changing ofranges
causes changing ofrowCount
. I'm not sure that whetherhelper.chosenRanges.Range()
is suitable for estimating row count since it comes from(*indexJoinBuildHelper).buildTemplateRange
, which seems to fill empty datum in some ranges.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.
After talking with @qw4990,
ranges
here only affects calculating seek cost of probe-side, it doesn't affect calculating row count or other stats. Hence it's OK.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.
ranges
won't affectrowCount
here ~And actually,
helper.chosenRanges.Range()
is the only range we can use to calculate seek cost. In most cases,chosenRanges
is[NULL, NULL]
andlen(chosenRanges)
is 1, which is equal to what we use nowlen(FullRange)
. For queries likeselect /*+ use_index(t1, ab) */ * from t1, t2 where t1.a in (1, 2, 3) and t1.b=t2.b
, it can be large than 1 and more accurate thanlen(FullRange)
.