During (full) statistics collection we sometimes use addOuterBuckets to add buckets above and below the observed max and min values to account for extra distinct count:
|
// addOuterBuckets adds buckets above and below the existing buckets in the |
|
// histogram to include the remaining distinct values in remDistinctCount. It |
|
// also increments the counters rowCountEq, distinctCountEq, rowCountRange, and |
|
// distinctCountRange as needed. |
|
func (h *histogram) addOuterBuckets( |
Unfortunately these buckets mislead the new USING EXTREMES partial statistics collection into only collecting stats above and below the max and min values for the column type.
I was hoping to delete addOuterBuckets when #83730 is fixed, so this might be fixed by that as well.
Jira issue: CRDB-22155
During (full) statistics collection we sometimes use
addOuterBucketsto add buckets above and below the observed max and min values to account for extra distinct count:cockroach/pkg/sql/stats/histogram.go
Lines 417 to 421 in 7ee9708
Unfortunately these buckets mislead the new
USING EXTREMESpartial statistics collection into only collecting stats above and below the max and min values for the column type.I was hoping to delete
addOuterBucketswhen #83730 is fixed, so this might be fixed by that as well.Jira issue: CRDB-22155