Skip to content

planner: correct estimated row count for inner plan of index join#10015

Merged
zz-jason merged 5 commits intopingcap:masterfrom
eurekaka:index_join_table_scan
Apr 4, 2019
Merged

planner: correct estimated row count for inner plan of index join#10015
zz-jason merged 5 commits intopingcap:masterfrom
eurekaka:index_join_table_scan

Conversation

@eurekaka
Copy link
Copy Markdown
Contributor

@eurekaka eurekaka commented Apr 3, 2019

What problem does this PR solve?

For index join, if inner plan is table scan, i.e, handle is index join key, and if there is selection above table scan, the estimated row count is wrong. This should has no impact on the final plan chosen, but the explain output is confusing, so I fix it.

What is changed and how it works?

Use stats of table scan instead of datasource as the stats of selection.

Check List

Tests

  • Unit test: existing UT covers this fix
  • Integration test: existing integration test covers this fix

Code changes

N/A

Side effects

N/A

Related changes

  • Need to cherry-pick to the release branch

@eurekaka eurekaka added type/bugfix This PR fixes a bug. sig/planner SIG: Planner labels Apr 3, 2019
@eurekaka
Copy link
Copy Markdown
Contributor Author

eurekaka commented Apr 3, 2019

/run-all-tests

Copy link
Copy Markdown
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 Apr 3, 2019
Copy link
Copy Markdown
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 Apr 4, 2019
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 4, 2019

Codecov Report

Merging #10015 into master will increase coverage by 0.001%.
The diff coverage is 100%.

@@               Coverage Diff               @@
##             master     #10015       +/-   ##
===============================================
+ Coverage   77.7034%   77.7044%   +0.001%     
===============================================
  Files           403        403               
  Lines         81878      81873        -5     
===============================================
- Hits          63622      63619        -3     
+ Misses        13558      13557        -1     
+ Partials       4698       4697        -1

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/bugfix This PR fixes a bug.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants