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: use HistColl containing all columns for row width estimation #11689

Merged
merged 4 commits into from Aug 9, 2019

Conversation

@eurekaka
Copy link
Contributor

commented Aug 8, 2019

What problem does this PR solve?

Currently, we are using tableStats to estimate row width, while tableStats only contains the columns remained after applying column pruning rule, it does not include all columns of the table, so when calling its method GetAvgRowSize, some columns cannot be found and hence we use pesudoColSize for them.

What is changed and how it works?

This PR build tblColHists from DataSource::statisticTable and save it in DataSource, and then use it for row width estimation.

Check List

Tests

  • Unit test: I did't figure out a simple way to add unit test for this PR.
  • Manual test (add detailed scripts or steps below)
create table tbl(a int primary key, b int, c int)
insert into tbl values(1,1,1),(2,2,2);
analyze table tbl;

explain select a from tbl;
-- observe the behavior of GetAvgRowSize by adding debug log or using debugger

Code changes

  • Has exported function/method change

Side effects

N/A

Related changes

N/A

@eurekaka

This comment has been minimized.

Copy link
Contributor Author

commented Aug 8, 2019

/run-all-tests

@codecov

This comment has been minimized.

Copy link

commented Aug 8, 2019

Codecov Report

Merging #11689 into master will not change coverage.
The diff coverage is n/a.

@@             Coverage Diff             @@
##             master     #11689   +/-   ##
===========================================
  Coverage   81.5122%   81.5122%           
===========================================
  Files           429        429           
  Lines         92845      92845           
===========================================
  Hits          75680      75680           
  Misses        11780      11780           
  Partials       5385       5385
planner/core/task.go Outdated Show resolved Hide resolved

@eurekaka eurekaka requested a review from lamxTyler Aug 8, 2019

@lamxTyler
Copy link
Member

left a comment

LGTM

@zz-jason
Copy link
Member

left a comment

LGTM

@sre-bot

This comment has been minimized.

Copy link

commented Aug 9, 2019

/run-all-tests

@sre-bot sre-bot merged commit d51a3e0 into pingcap:master Aug 9, 2019

14 checks passed

ci/circleci Your tests passed on CircleCI!
Details
idc-jenkins-ci-tidb/build Jenkins job succeeded.
Details
idc-jenkins-ci-tidb/build_check_race Jenkins job succeeded.
Details
idc-jenkins-ci-tidb/check_dev Jenkins job succeeded.
Details
idc-jenkins-ci-tidb/check_dev_2 Jenkins job succeeded.
Details
idc-jenkins-ci-tidb/common-test job succeeded
Details
idc-jenkins-ci-tidb/integration-common-test Jenkins job succeeded.
Details
idc-jenkins-ci-tidb/integration-compatibility-test Jenkins job succeeded.
Details
idc-jenkins-ci-tidb/integration-ddl-test Jenkins job succeeded.
Details
idc-jenkins-ci-tidb/mybatis-test job succeeded
Details
idc-jenkins-ci-tidb/sqllogic-test-1 Jenkins job succeeded.
Details
idc-jenkins-ci-tidb/sqllogic-test-2 Jenkins job succeeded.
Details
idc-jenkins-ci-tidb/unit-test Jenkins job succeeded.
Details
license/cla Contributor License Agreement is signed.
Details

@eurekaka eurekaka deleted the eurekaka:tbl_cols_stats branch Aug 9, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.