-
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
statistics: test the auto analyze and feedback for the global-level stats #23181
Conversation
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.
There are some feedback missing from other places, such as IndexMergeReader
@rebelice: 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 ti-community-infra/tichi repository. |
/sig planner |
…balHist4MutilColumns
/run-all-tests |
/run-all-tests |
// Do not collect the feedback when the table is the partition table. | ||
if collect && tbl.Meta().Partition != nil { | ||
collect = false | ||
} |
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.
Could you please also add this check into Handle.UpdateStatsByLocalFeedback
where TiDB uses feedbacks to update its statistics, which makes it safer and can completely remove the impact of feedback on global-stats?
statistics/handle/handle_test.go
Outdated
@@ -1601,6 +1601,104 @@ func (s *statsSerialSuite) TestGCIndexUsageInformation(c *C) { | |||
tk.MustQuery(querySQL).Check(testkit.Rows("0")) | |||
} | |||
|
|||
func (s *testStatsSuite) TestFeedbackWithGlobalStats(c *C) { |
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.
Should we use statsSerialSuite
here?
…balHist4MutilColumns
…o testGlobalHist4MutilColumns
@@ -508,8 +508,8 @@ func (s *testFastAnalyze) TestFastAnalyze(c *C) { | |||
*/ | |||
|
|||
// test fast analyze in dynamic mode | |||
tk.MustExec("set @@tidb_analyze_version = 2;") | |||
tk.MustExec("set @@tidb_partition_prune_mode = 'dynamic';") | |||
tk.MustExec("set @@session.tidb_analyze_version = 2;") |
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
statistics/handle/update_test.go
Outdated
@@ -1215,10 +1216,11 @@ func (s *testStatsSuite) TestUpdatePartitionStatsByLocalFeedback(c *C) { | |||
pid := tblInfo.Partition.Definitions[0].ID | |||
tbl := h.GetPartitionStats(tblInfo, pid) | |||
|
|||
// // Feedback will not take effect under partition table. |
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.
// // Feedback will not take effect under partition table. | |
// Feedback will not take effect under partition table. |
/LGTM |
[REVIEW NOTIFICATION] This pull request has been approved by:
To complete the pull request process, please ask the reviewers in the list to review by filling The full list of commands accepted by this bot can be found here. Reviewer can indicate their review by writing |
…o testGlobalHist4MutilColumns
…balHist4MutilColumns
/run-all-tests |
/run-unit-test |
1 similar comment
/run-unit-test |
/merge |
This pull request has been accepted and is ready to merge. Commit hash: e50fbdc
|
/merge |
/run-unit-test |
@Reminiscent: Your PR was out of date, I have automatically updated it for you. At the same time I will also trigger all tests for you: /run-all-tests If the CI test fails, you just re-trigger the test that failed and the bot will merge the PR for you after the CI passes. 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 ti-community-infra/tichi repository. |
What problem does this PR solve?
Test the
auto analyze
andfeedback
for the global-level stats.What is changed and how it works?
Test the
auto analyze
andfeedback
for the global-level stats.Related changes
pingcap/docs
/pingcap/docs-cn
:Check List
Tests
Side effects
Release note