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 combined index low-bound check #7814

Merged
merged 6 commits into from
Oct 8, 2018
Merged

stats: fix combined index low-bound check #7814

merged 6 commits into from
Oct 8, 2018

Conversation

lysu
Copy link
Contributor

@lysu lysu commented Sep 28, 2018

What problem does this PR solve?

fixes #7813

=1 will failure in low-bound check and break, so can not do following cm-sketch logic.

What is changed and how it works?

for range (kid1, pid2) ~ (kid2,pid2), judge kid1 as hit in range.

Check List

Tests

  • unit test

Code changes

  • logic change

Side effects

  • no

Related changes

  • Need to cherry-pick to the release branch

This change is Reviewable

@lysu lysu added type/bugfix This PR fixes a bug. component/statistics labels Sep 28, 2018
@lysu
Copy link
Contributor Author

lysu commented Sep 28, 2018

/run-all-tests

@lysu lysu requested a review from alivxxx September 28, 2018 14:24
@lysu lysu changed the title statistics: fix combined index low-bound check stats: fix combined index low-bound check Sep 29, 2018

}

func (hg *Histogram) canCMSketch(val types.Datum, partialCover bool) bool {
Copy link
Contributor

Choose a reason for hiding this comment

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

I feel it is a little awkward: why histogram needs to care about cm sketch? Maybe a better solution is to have different outOfRange for Column and Index.

@lysu lysu removed the status/WIP label Sep 29, 2018
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

@lysu lysu added the status/LGT1 Indicates that a PR has LGTM 1. label Sep 29, 2018
}

// CompareOpt compares the value with ad with prefixAsEq optional
func CompareOpt(row Row, colIdx int, ad *types.Datum, prefixAsEq bool) int {
Copy link
Member

Choose a reason for hiding this comment

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

Please add comments for prefixAsEq.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

emmm..this param is stranger, I tried to refactor it

@lysu
Copy link
Contributor Author

lysu commented Sep 29, 2018

/run-all-tests

Copy link
Contributor

@crazycs520 crazycs520 left a comment

Choose a reason for hiding this comment

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

LGTM

@crazycs520 crazycs520 added status/LGT2 Indicates that a PR has LGTM 2. and removed status/LGT1 Indicates that a PR has LGTM 1. labels Sep 29, 2018
@alivxxx
Copy link
Contributor

alivxxx commented Oct 8, 2018

/run-all-tests

@lysu lysu merged commit d5d8ba0 into pingcap:master Oct 8, 2018
@lysu lysu deleted the dev/fix-combined-index-first-element-stats branch October 8, 2018 06:30
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.

combined index low bound check question
4 participants