sql/stats: support SHOW HISTOGRAM for forecasted stats #86358
Labels
A-sql-table-stats
Table statistics (and their automatic refresh).
C-enhancement
Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)
T-sql-queries
SQL Queries Team
X-nostale
Marks an issue/pr that should be ignored by the stale bot
Follow up from #79872: we currently support
SHOW STATISTICS ... WITH FORECAST
but thehistogram_id
field is always 0 for forecasts, andSHOW HISTOGRAM
does not work.For example:
We can show histograms of the collected statistics, but not the forecasted statistics:
As a workaround we can use
SHOW STATISTICS USING JSON ... WITH FORECAST
but it's pretty ugly:I think the trick to doing this will be to encode the table ID and column ID in the histogram_id.
Jira issue: CRDB-18713
The text was updated successfully, but these errors were encountered: