Skip to content

Commit

Permalink
wip: opt: do not use histograms for constrains outside the min and max
Browse files Browse the repository at this point in the history
  • Loading branch information
mgartner committed Jan 23, 2025
1 parent 97224b4 commit 43bfd76
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/sql/opt/memo/statistics_builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -4000,6 +4000,9 @@ func (sb *statisticsBuilder) updateHistogram(
if inputHist != nil && ok {
if _, _, ok := inputHist.CanFilter(sb.ctx, c); ok {
colStat.Histogram = inputHist.Filter(sb.ctx, c)
if colStat.Histogram.ValuesCount() == 0 {
return false
}
sb.updateDistinctCountFromHistogram(colStat, inputStat.DistinctCount)
return true
}
Expand Down

0 comments on commit 43bfd76

Please sign in to comment.