sql: fix aggregation of statistics#85987
Merged
craig[bot] merged 1 commit intocockroachdb:masterfrom Aug 12, 2022
Merged
Conversation
Member
Contributor
|
Maybe we can add a logic test with the case you saw in the issue or similar |
2e42e58 to
89cdf18
Compare
maryliag
commented
Aug 11, 2022
Contributor
Author
maryliag
left a comment
There was a problem hiding this comment.
Reviewable status:
complete! 0 of 0 LGTMs obtained (waiting on @xinhaoz)
pkg/sql/logictest/testdata/logic_test/create_statements line 1574 at r1 (raw file):
Previously, xinhaoz (Xin Hao Zhang) wrote…
Maybe we can add a logic test with the case you saw in the issue or similar
Tests added
0d3dc2d to
989bbc7
Compare
Previously, because we were using a join, we were double counting statistics when we had the same fingerprint in memory and persisted that had more than one index recommendation. This commit adds a `DISTINCT` so we only count them once. Fixes cockroachdb#85958 Release note: None
989bbc7 to
de478e1
Compare
xinhaoz
approved these changes
Aug 12, 2022
Contributor
xinhaoz
left a comment
There was a problem hiding this comment.
Reviewed 1 of 1 files at r2.
Reviewable status:complete! 1 of 0 LGTMs obtained (waiting on @xinhaoz)
Contributor
Author
|
TFTR! |
Contributor
|
Build succeeded: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Previously, because we were using a join, we were double
counting statistics when we had the same fingerprint in
memory and persisted.
This commit adds a
DISTINCTso we only count them once.Fixes #85958
Release note: None