Commit 2cba92a
committed
sql/stats: improve SHOW STATISTICS with merged and forecasted stats
This commit make `SHOW STATISTICS` compute merged stats unconditionally,
and output them only if `WITH MERGE` is specified. Previously, we would
compute merged stats only if `WITH MERGE` was specified, which could
prevent us from seeing forecasted stats that depend on merged stats when
specifying `WITH FORECAST` (without `MERGE`). This change is consistent
with the stats cache, which computes merged stats unconditionally and
uses them to create forecasts.
Fixes: #155612
Release note (bug fix): Previously, we could have inconsistencies
between the forecasted stats shown in `SHOW STATISTICS ... WITH
FORECAST` and forecasted stats in the stats cache depending on whether
`WITH MERGE` was also specified. We now correctly display all forecasted
stats, regardless of `WITH MERGE`.1 parent 3c76919 commit 2cba92a
File tree
2 files changed
+14
-2
lines changed- pkg/sql
- opt/exec/execbuilder/testdata
2 files changed
+14
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
431 | 431 | | |
432 | 432 | | |
433 | 433 | | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
434 | 446 | | |
435 | 447 | | |
436 | 448 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
195 | 195 | | |
196 | 196 | | |
197 | 197 | | |
| 198 | + | |
| 199 | + | |
198 | 200 | | |
199 | | - | |
200 | | - | |
201 | 201 | | |
202 | 202 | | |
203 | 203 | | |
| |||
0 commit comments