-
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
statistics: test the auto analyze and feedback for the global-level stats #23181
Merged
ti-chi-bot
merged 26 commits into
pingcap:master
from
Reminiscent:testGlobalHist4MutilColumns
Mar 10, 2021
Merged
Changes from 17 commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
167723c
add test cases for auto anlyze and feedback
Reminiscent d866ce2
fix test
Reminiscent fd5adaf
statistics: test the auto analyze and feedback for the global-level s…
Reminiscent 12e48d4
Merge branch 'master' of https://github.com/pingcap/tidb into testGlo…
Reminiscent d863fc1
fix ut and refactor the code
Reminiscent ad341bc
forbid the feedback for the partition table
Reminiscent 80711d4
change the comment
Reminiscent e8c97e5
update the test
Reminiscent 5c48a82
Merge branch 'master' of https://github.com/pingcap/tidb into testGlo…
Reminiscent 01f9e7f
Merge branch 'master' into testGlobalHist4MutilColumns
Reminiscent 405debd
Merge branch 'master' of https://github.com/pingcap/tidb into testGlo…
Reminiscent f914859
address comments
Reminiscent 9fb318d
Merge remote-tracking branch 'origin/testGlobalHist4MutilColumns' int…
Reminiscent 4027f71
address comments
Reminiscent 787c204
Merge branch 'master' into testGlobalHist4MutilColumns
qw4990 f7e22a1
address comments
Reminiscent 5744f8c
Merge remote-tracking branch 'origin/testGlobalHist4MutilColumns' int…
Reminiscent d8e609c
address comments
Reminiscent e50fbdc
Merge branch 'master' of https://github.com/pingcap/tidb into testGlo…
Reminiscent 41d7447
Merge branch 'master' into testGlobalHist4MutilColumns
ti-chi-bot ba07e13
Merge branch 'master' into testGlobalHist4MutilColumns
qw4990 d7a6a08
Merge branch 'master' into testGlobalHist4MutilColumns
ti-chi-bot e099d1f
Merge branch 'master' into testGlobalHist4MutilColumns
ti-chi-bot 6eb6a9d
Merge branch 'master' into testGlobalHist4MutilColumns
ti-chi-bot db272c6
Merge branch 'master' into testGlobalHist4MutilColumns
ti-chi-bot ad11f33
Merge branch 'master' into testGlobalHist4MutilColumns
ti-chi-bot 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2559,6 +2559,10 @@ func buildNoRangeTableReader(b *executorBuilder, v *plannercore.PhysicalTableRea | |
e.feedback = statistics.NewQueryFeedback(getFeedbackStatsTableID(e.ctx, tbl), ts.Hist, int64(ts.StatsCount()), ts.Desc) | ||
} | ||
collect := statistics.CollectFeedback(b.ctx.GetSessionVars().StmtCtx, e.feedback, len(ts.Ranges)) | ||
// Do not collect the feedback when the table is the partition table. | ||
if collect && tbl.Meta().Partition != nil { | ||
collect = false | ||
} | ||
Comment on lines
+2562
to
+2565
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could you please also add this check into |
||
if !collect { | ||
e.feedback.Invalidate() | ||
} | ||
|
@@ -2830,6 +2834,10 @@ func buildNoRangeIndexReader(b *executorBuilder, v *plannercore.PhysicalIndexRea | |
e.feedback = statistics.NewQueryFeedback(tblID, is.Hist, int64(is.StatsCount()), is.Desc) | ||
} | ||
collect := statistics.CollectFeedback(b.ctx.GetSessionVars().StmtCtx, e.feedback, len(is.Ranges)) | ||
// Do not collect the feedback when the table is the partition table. | ||
if collect && tbl.Meta().Partition != nil { | ||
collect = false | ||
} | ||
if !collect { | ||
e.feedback.Invalidate() | ||
} | ||
|
@@ -2968,6 +2976,10 @@ func buildNoRangeIndexLookUpReader(b *executorBuilder, v *plannercore.PhysicalIn | |
collectTable := false | ||
e.tableRequest.CollectRangeCounts = &collectTable | ||
collectIndex := statistics.CollectFeedback(b.ctx.GetSessionVars().StmtCtx, e.feedback, len(is.Ranges)) | ||
// Do not collect the feedback when the table is the partition table. | ||
if collectIndex && tbl.Meta().Partition != nil { | ||
collectIndex = false | ||
} | ||
if !collectIndex { | ||
e.feedback.Invalidate() | ||
} | ||
|
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
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.
Why do you add
session
? The two should be equivalent