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

stats: fix the index cm sketch for fast analyze #10839

Merged
merged 6 commits into from
Jun 22, 2019

Conversation

alivxxx
Copy link
Contributor

@alivxxx alivxxx commented Jun 18, 2019

What problem does this PR solve?

The index CM sketch of fast analyze is wrong, it does not consider the prefix columns.

What is changed and how it works?

Built cm sketch for each prefix columns of index, and merge them into one as the final result.

Check List

Tests

  • Unit test

Code changes

  • Has exported function/method change

Side effects

  • None

Related changes

  • Need to cherry-pick to the release branch

@codecov
Copy link

codecov bot commented Jun 18, 2019

Codecov Report

Merging #10839 into master will decrease coverage by 0.151%.
The diff coverage is 88.2352%.

@@               Coverage Diff                @@
##             master     #10839        +/-   ##
================================================
- Coverage   81.0684%   80.9174%   -0.1511%     
================================================
  Files           419        419                
  Lines         88894      88793       -101     
================================================
- Hits          72065      71849       -216     
- Misses        11600      11709       +109     
- Partials       5229       5235         +6

return sorted[i] > sorted[j]
})
numTop = mathutil.MinUint32(uint32(len(counter)), numTop)
lastTopCnt := sorted[numTop-1]
Copy link
Contributor

Choose a reason for hiding this comment

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

if numTop is 0, this will panic? executor/analyze.go #334 set numTop is 0

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, they don't have top n and won't go into this function.

@zz-jason zz-jason added the priority/release-blocker This issue blocks a release. Please solve it ASAP. label Jun 19, 2019
@alivxxx alivxxx requested a review from winoros June 19, 2019 08:30
Copy link
Contributor

@eurekaka eurekaka left a comment

Choose a reason for hiding this comment

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

LGTM

@eurekaka eurekaka added the status/LGT1 Indicates that a PR has LGTM 1. label Jun 20, 2019
@alivxxx
Copy link
Contributor Author

alivxxx commented Jun 20, 2019

/run-all-tests

1 similar comment
@alivxxx
Copy link
Contributor Author

alivxxx commented Jun 20, 2019

/run-all-tests

@alivxxx
Copy link
Contributor Author

alivxxx commented Jun 20, 2019

/run-unit-test

2 similar comments
@alivxxx
Copy link
Contributor Author

alivxxx commented Jun 20, 2019

/run-unit-test

@alivxxx
Copy link
Contributor Author

alivxxx commented Jun 20, 2019

/run-unit-test

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 Jun 22, 2019
@zz-jason zz-jason merged commit b26cb0d into pingcap:master Jun 22, 2019
@alivxxx alivxxx deleted the cm-sketch branch June 22, 2019 05:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/statistics priority/release-blocker This issue blocks a release. Please solve it ASAP. 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.

6 participants