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: improve estimation for index equal condition (#17366) #17609

Merged
merged 5 commits into from
Jul 24, 2020

Conversation

sre-bot
Copy link
Contributor

@sre-bot sre-bot commented Jun 3, 2020

cherry-pick #17366 to release-3.0


What problem does this PR solve?

Issue Number: close #17364

Problem Summary:

Wrong plan is chosen when index equal condition contains value which is out of the range of the histogram.

What is changed and how it works?

What's Changed:

Compute the NDV for the prefix columns of the index which are used for equal condition, and use it for row count guess.

How it Works:

It is more reasonable than hard-coded constant outOfRangeBetweenRate.

Related changes

N/A

Check List

Tests

  • Unit test

Side effects

N/A

Release note

  • improve row count estimation for index equal condition

Signed-off-by: sre-bot <sre-bot@pingcap.com>
@sre-bot
Copy link
Contributor Author

sre-bot commented Jun 3, 2020

/run-all-tests

Copy link
Member

@zz-jason zz-jason left a comment

Choose a reason for hiding this comment

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

@eurekaka please resolve conflicts and fix CI.

@eurekaka
Copy link
Contributor

/run-unit-test

@eurekaka
Copy link
Contributor

/run-check_dev

@qw4990 qw4990 modified the milestones: v3.0.16, v3.0.17 Jun 28, 2020
@eurekaka eurekaka added the priority/release-blocker This PR blocks a release. Please review it ASAP. label Jul 24, 2020
@eurekaka eurekaka requested a review from zz-jason July 24, 2020 06:34
Copy link
Member

@winoros winoros left a comment

Choose a reason for hiding this comment

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

lgtm

@ti-srebot ti-srebot added the status/LGT1 Indicates that a PR has LGTM 1. label Jul 24, 2020
Copy link
Member

@zz-jason zz-jason left a comment

Choose a reason for hiding this comment

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

LGTM

@ti-srebot ti-srebot removed the status/LGT1 Indicates that a PR has LGTM 1. label Jul 24, 2020
@ti-srebot ti-srebot added the status/LGT2 Indicates that a PR has LGTM 2. label Jul 24, 2020
@zz-jason
Copy link
Member

/merge

@ti-srebot ti-srebot added the status/can-merge Indicates a PR has been approved by a committer. label Jul 24, 2020
@ti-srebot
Copy link
Contributor

/run-all-tests

@ti-srebot ti-srebot merged commit 0f44fef into pingcap:release-3.0 Jul 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/statistics priority/release-blocker This PR blocks a release. Please review it ASAP. sig/planner SIG: Planner status/can-merge Indicates a PR has been approved by a committer. status/LGT2 Indicates that a PR has LGTM 2. type/enhancement type/3.0-cherry-pick
Projects
None yet
Development

Successfully merging this pull request may close these issues.

improve row count estimation for index equal condition
7 participants