Commit 49bbc71
Merge #155615
155615: sql/stats: improve SHOW STATISTICS with merged and forecasted stats r=Uzair5162 a=Uzair5162
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`.
Co-authored-by: Uzair Ahmad <uzair.ahmad@cockroachlabs.com>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 | |
|---|---|---|---|
| |||
419 | 419 | | |
420 | 420 | | |
421 | 421 | | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
422 | 434 | | |
423 | 435 | | |
424 | 436 | | |
| |||
| 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