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

statistics: set correlation when loading needed column histogram #9701

Merged
merged 8 commits into from
Mar 14, 2019

Conversation

eurekaka
Copy link
Contributor

What problem does this PR solve?

Fix #9700

What is changed and how it works?

RCA: column is marked as needed by the explain query, so the histogram would be built in LoadNeedHistograms, which does not set correlation field properly. Later in updateStatsWorker, it finds that column is not nil, so it would not build a new one, thus the correlation of column has no chance to be updated anymore.

Set correlation using the one queried from storage initially in LoadNeededHistograms.

Check List

Tests

  • Unit test

Code changes

  • Has exported function/method change

Side effects

N/A

Related changes

N/A

@codecov
Copy link

codecov bot commented Mar 13, 2019

Codecov Report

Merging #9701 into master will increase coverage by 0.0114%.
The diff coverage is 100%.

@@               Coverage Diff                @@
##             master      #9701        +/-   ##
================================================
+ Coverage   67.3428%   67.3543%   +0.0114%     
================================================
  Files           378        378                
  Lines         79514      79542        +28     
================================================
+ Hits          53547      53575        +28     
+ Misses        21192      21191         -1     
- Partials       4775       4776         +1

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 Mar 13, 2019
@eurekaka
Copy link
Contributor Author

/run-all-tests

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 Mar 14, 2019
@eurekaka eurekaka merged commit c5c3091 into pingcap:master Mar 14, 2019
@eurekaka eurekaka deleted the load_corr branch March 14, 2019 08:28
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/bugfix This PR fixes a bug.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants