cockroachdb / cockroachdb/cockroach
sql: stats forecasts can have too many histogram buckets
Open
A-sql-table-stats
C-bug
O-support
P-3
T-sql-queries
- Dominant language
- Go
- Stars
- 32.5k
- Forks
- 4.1k
- PR merge metrics
- PR metrics pending
Description
See https://github.com/cockroachlabs/support/issues/2792
A few stats collections with <200 buckets produced 800+ buckets in the forecast. This adds additional work for the optimizer to scan and filter those buckets during optimization. Combining the buckets would alleviate some work for the optimizer.
I attempted to created a test case [here](https://github.com/cockroachdb/cockroach/blob/fb972bc3b45866ded2eadd4dfbd83c1b3c276b8f/pkg/sql/stats/forecast_test.go#L29) to show as an example, but was unable to reproduce with a basic test case.
Jira issue: CRDB-35404
Contributor guide
Assessment
This issue has not been assessed yet.