Planner: Small NDV results in too many histogram buckets.
Open
type/enhancement
- Dominant language
- Go
- Stars
- 40.5k
- Forks
- 6.2k
- PR merge metrics
- PR metrics pending
Description
## Enhancement
The concept behind histograms for optimizer statistics is to represent a range of values - it's cardinality, and number of duplicates per value. Having a very small number of values per bucket results in too many buckets - which drives up the number of statistics we manage.
There are exceptions - where capturing the ranges such that gaps appear between buckets vs within bucket could result in the need for more buckets - but sampling can distort this and mislead the optimizer.
Contributor guide
Assessment
This issue has not been assessed yet.