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

planner: fix the inappropriate out-of-range range estimation rule #21207

Open
wants to merge 19 commits into
base: master
Choose a base branch
from

Conversation

tangwz
Copy link
Contributor

@tangwz tangwz commented Nov 23, 2020

What problem does this PR solve?

Issue Number: close #20989

Problem Summary: fix the inappropriate out-of-range range estimation rule

What is changed and how it works?

What's Changed:

Add function outOfRangeIntervalSelectivity.

How it Works:

When estimating the number of rows for ranges in GetColumnRowCount, if the range is out-of-range, for example, the range's upper bound is less than the minimum value in statistics, TiDB uses outOfRangeEQSelectivity, but this is inappropriate since outOfRangeEQSelectivity is created for point estimation instead of range estimation.
It's better to create a new function outOfRangeIntervalSelectivity for range estimation.

Related changes

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

Check List

Tests

  • Unit test

Side effects

  • None

Release note

  • No release note

@tangwz tangwz requested a review from a team as a code owner November 23, 2020 07:11
@tangwz tangwz requested review from SunRunAway and removed request for a team November 23, 2020 07:11
@qw4990 qw4990 requested review from qw4990 and winoros November 24, 2020 03:25
@qw4990 qw4990 added the sig/planner SIG: Planner label Nov 30, 2020
Copy link
Contributor

@qw4990 qw4990 left a comment

Choose a reason for hiding this comment

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

@qw4990
Copy link
Contributor

qw4990 commented Dec 2, 2020

And also please add some unit tests :D @tangwz

@tangwz tangwz changed the title [WIP]planner: fix the inappropriate out-of-range range estimation rule planner: fix the inappropriate out-of-range range estimation rule Dec 8, 2020
@SunRunAway SunRunAway added the priority/release-blocker This issue blocks a release. Please solve it ASAP. label Dec 9, 2020
@Reminiscent
Copy link
Contributor

@tangwz Please fix the unit tests. Thanks!

@tangwz
Copy link
Contributor Author

tangwz commented Jan 18, 2021

@Reminiscent @qw4990 PTAL.

@ti-chi-bot
Copy link
Member

@tangwz: PR needs rebase.

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 kubernetes/test-infra repository.

@ti-chi-bot ti-chi-bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Feb 23, 2021
@zz-jason zz-jason removed the priority/release-blocker This issue blocks a release. Please solve it ASAP. label Mar 26, 2021
@winoros winoros removed request for SunRunAway and winoros June 16, 2021 08:03
@ti-chi-bot ti-chi-bot bot deleted a comment from ti-chi-bot Dec 19, 2023
Copy link

ti-chi-bot bot commented Nov 18, 2024

@tangwz: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
idc-jenkins-ci-tidb/mysql-test ef9cee5 link true /test mysql-test
pull-mysql-client-test ef9cee5 link true /test pull-mysql-client-test
idc-jenkins-ci-tidb/build ef9cee5 link true /test build
idc-jenkins-ci-tidb/check_dev ef9cee5 link true /test check-dev
idc-jenkins-ci-tidb/check_dev_2 ef9cee5 link true /test check-dev2
idc-jenkins-ci-tidb/unit-test ef9cee5 link true /test unit-test
pull-integration-ddl-test ef9cee5 link true /test pull-integration-ddl-test
pull-br-integration-test ef9cee5 link true /test pull-br-integration-test
pull-lightning-integration-test ef9cee5 link true /test pull-lightning-integration-test
pull-integration-e2e-test ef9cee5 link true /test pull-integration-e2e-test

Full PR test history. Your PR dashboard.

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 kubernetes/test-infra repository. I understand the commands that are listed here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/statistics needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. sig/planner SIG: Planner
Projects
None yet
Development

Successfully merging this pull request may close these issues.

planner: fix the inappropriate out-of-range range estimation rule
7 participants