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

plan: handle DNF expressions in Selectivity #9282

Merged
merged 8 commits into from
Feb 13, 2019

Conversation

eurekaka
Copy link
Contributor

What problem does this PR solve?

Fix #8921

What is changed and how it works?

Consider DNF expressions when extracting ranges for estimation in Selectivity.

Check List

Tests

  • Integration test

Code changes

N/A

Side effects

N/A

Related changes

N/A

@eurekaka eurekaka added type/enhancement The issue or PR belongs to an enhancement. sig/planner SIG: Planner labels Feb 12, 2019
util/ranger/detacher.go Outdated Show resolved Hide resolved
@codecov-io
Copy link

codecov-io commented Feb 12, 2019

Codecov Report

Merging #9282 into master will increase coverage by 0.01%.
The diff coverage is 74.6%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #9282      +/-   ##
==========================================
+ Coverage   67.22%   67.24%   +0.01%     
==========================================
  Files         371      371              
  Lines       77271    77299      +28     
==========================================
+ Hits        51949    51978      +29     
- Misses      20682    20685       +3     
+ Partials     4640     4636       -4
Impacted Files Coverage Δ
planner/core/common_plans.go 59.9% <33.33%> (-1.08%) ⬇️
planner/core/exhaust_physical_plans.go 94.08% <50%> (ø) ⬆️
planner/core/logical_plans.go 72.58% <71.42%> (+0.33%) ⬆️
statistics/selectivity.go 56.59% <81.25%> (+1.1%) ⬆️
util/ranger/detacher.go 81.19% <83.33%> (-2.68%) ⬇️
infoschema/infoschema.go 76.31% <0%> (-1.32%) ⬇️
expression/schema.go 93.75% <0%> (-0.79%) ⬇️
store/tikv/region_cache.go 83.33% <0%> (-0.58%) ⬇️
executor/index_lookup_join.go 77.91% <0%> (+0.63%) ⬆️
... and 3 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2f9ab60...ce4821b. Read the comment docs.

@eurekaka
Copy link
Contributor Author

/run-all-tests

statistics/selectivity.go Outdated Show resolved Hide resolved
util/ranger/detacher.go Outdated Show resolved Hide resolved
@eurekaka
Copy link
Contributor Author

/run-all-tests

Copy link
Contributor

@alivxxx alivxxx left a comment

Choose a reason for hiding this comment

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

LGTM

@alivxxx alivxxx added the status/LGT1 Indicates that a PR has LGTM 1. label Feb 12, 2019
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 zz-jason added status/LGT2 Indicates that a PR has LGTM 2. and removed status/LGT1 Indicates that a PR has LGTM 1. labels Feb 13, 2019
@eurekaka eurekaka merged commit 9bdba3a into pingcap:master Feb 13, 2019
@eurekaka eurekaka deleted the dnf_selectivity branch February 13, 2019 02:53
@zz-jason
Copy link
Member

@eurekaka We'd better to cherry pick this commit to release 2.1.

eurekaka added a commit to eurekaka/tidb that referenced this pull request Feb 21, 2019
jackysp pushed a commit that referenced this pull request Feb 21, 2019
* plan: handle DNF expressions in `Selectivity` (#9282)

* update explain output
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sig/planner SIG: Planner 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.

5 participants