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

statistics: test the auto analyze and feedback for the global-level stats #23181

Merged
merged 26 commits into from
Mar 10, 2021

Conversation

Reminiscent
Copy link
Contributor

What problem does this PR solve?

Test the auto analyze and feedback for the global-level stats.

What is changed and how it works?

Test the auto analyze and feedback for the global-level stats.

Related changes

  • PR to update pingcap/docs/pingcap/docs-cn:
  • Need to cherry-pick to the release branch

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No code

Side effects

  • Performance regression
    • Consumes more CPU
    • Consumes more MEM
  • Breaking backward compatibility

Release note

  • No release note

@Reminiscent Reminiscent requested a review from a team as a code owner March 9, 2021 02:22
@Reminiscent Reminiscent requested review from lzmhhh123 and removed request for a team March 9, 2021 02:22
@ti-chi-bot ti-chi-bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Mar 9, 2021
@Reminiscent Reminiscent requested a review from a team as a code owner March 9, 2021 03:30
@github-actions github-actions bot added the sig/execution SIG execution label Mar 9, 2021
Copy link
Contributor

@rebelice rebelice left a 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

@ti-chi-bot
Copy link
Member

@rebelice: /lgtm cancel is only allowed for the PR author or the reviewers in list.

In response to this:

There are some feedback missing from other places, such as IndexMergeReader

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.

@rebelice
Copy link
Contributor

rebelice commented Mar 9, 2021

/sig planner

@ti-chi-bot ti-chi-bot added the sig/planner SIG: Planner label Mar 9, 2021
@qw4990
Copy link
Contributor

qw4990 commented Mar 9, 2021

/run-all-tests

@Reminiscent
Copy link
Contributor Author

/run-all-tests

Comment on lines +2562 to +2565
// Do not collect the feedback when the table is the partition table.
if collect && tbl.Meta().Partition != nil {
collect = false
}
Copy link
Contributor

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?

@@ -1601,6 +1601,104 @@ func (s *statsSerialSuite) TestGCIndexUsageInformation(c *C) {
tk.MustQuery(querySQL).Check(testkit.Rows("0"))
}

func (s *testStatsSuite) TestFeedbackWithGlobalStats(c *C) {
Copy link
Contributor

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?

@Reminiscent
Copy link
Contributor Author

Update. PTAL @qw4990 @rebelice

@@ -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;")
Copy link
Contributor

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

@@ -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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// // Feedback will not take effect under partition table.
// Feedback will not take effect under partition table.

@qw4990
Copy link
Contributor

qw4990 commented Mar 10, 2021

/LGTM

@ti-chi-bot ti-chi-bot added the status/LGT1 Indicates that a PR has LGTM 1. label Mar 10, 2021
@ti-chi-bot
Copy link
Member

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • qw4990
  • rebelice

To complete the pull request process, please ask the reviewers in the list to review by filling /cc @reviewer in the comment.
After your PR has acquired the required number of LGTMs, you can assign this pull request to the committer in the list by filling /assign @committer in the comment to help you merge this pull request.

The full list of commands accepted by this bot can be found here.

Reviewer can indicate their review by writing /lgtm in a comment.
Reviewer can cancel approval by writing /lgtm cancel in a comment.

@ti-chi-bot ti-chi-bot added status/LGT2 Indicates that a PR has LGTM 2. and removed status/LGT1 Indicates that a PR has LGTM 1. labels Mar 10, 2021
@qw4990
Copy link
Contributor

qw4990 commented Mar 10, 2021

/run-all-tests

@qw4990
Copy link
Contributor

qw4990 commented Mar 10, 2021

/run-unit-test

1 similar comment
@Reminiscent
Copy link
Contributor Author

/run-unit-test

@qw4990
Copy link
Contributor

qw4990 commented Mar 10, 2021

/merge

@ti-chi-bot
Copy link
Member

This pull request has been accepted and is ready to merge.

Commit hash: e50fbdc

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label Mar 10, 2021
@qw4990
Copy link
Contributor

qw4990 commented Mar 10, 2021

/merge

@qw4990
Copy link
Contributor

qw4990 commented Mar 10, 2021

/run-unit-test

@ti-chi-bot
Copy link
Member

@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.

@ti-chi-bot ti-chi-bot merged commit 168ef88 into pingcap:master Mar 10, 2021
@Reminiscent Reminiscent deleted the testGlobalHist4MutilColumns branch August 5, 2021 01:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/statistics sig/execution SIG execution sig/planner SIG: Planner size/L Denotes a PR that changes 100-499 lines, ignoring generated files. status/can-merge Indicates a PR has been approved by a committer. status/LGT2 Indicates that a PR has LGTM 2.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants