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

stats: refine the row count estimation for unknown values #7175

Merged
merged 1 commit into from
Jul 29, 2018

Conversation

alivxxx
Copy link
Contributor

@alivxxx alivxxx commented Jul 27, 2018

What have you changed? (mandatory)

Before this PR, when are queries on values that stats do not know, we simply regard them as do not exist. However, stats may not up to date. This PR refine the estimation methods for unknown values:

  • For equality queries, we estimate them as on totalRowCount / NDV.
  • For range queries, we estimate them as an fraction of total modfiy count.

Fix #7127

What is the type of the changes? (mandatory)

  • Improvement (non-breaking change which is an improvement to an existing feature)

How has this PR been tested? (mandatory)

Unit test.

Does this PR affect documentation (docs/docs-cn) update? (mandatory)

No.

Does this PR affect tidb-ansible update? (mandatory)

No.

Does this PR need to be added to the release notes? (mandatory)

No.

Refer to a related PR or issue link (optional)

Benchmark result if necessary (optional)

Add a few positive/negative examples (optional)

PTAL @coocood @zz-jason @winoros

@alivxxx alivxxx added component/statistics type/enhancement The issue or PR belongs to an enhancement. labels Jul 27, 2018
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

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

@zz-jason
Copy link
Member

/run-all-tests

@coocood coocood added the status/LGT2 Indicates that a PR has LGTM 2. label Jul 29, 2018
@coocood
Copy link
Member

coocood commented Jul 29, 2018

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/statistics status/LGT2 Indicates that a PR has LGTM 2. type/enhancement The issue or PR belongs to an enhancement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants