Commit adc3de4
Merge #151502
151502: sql: set fraction stale rows to 4 on sql stats tables r=michae2,alyshanjahani-crl a=dhartunian
Previously, stats collection on StatementStatisticsTableSchema and
TransactionStatisticsTableSchema were triggered at 20% stale rows
which was very low and would trigger often during flushing of SQL
statement stats.
This commit adds a migration that sets
`sql_stats_automatic_collection_fraction_stale_rows` at 4 which will
reduce stats collection overhead. Since this table is updated very
regularly, we expect stats to stay up to date even with the higher
threshold.
As recommended, we also set
`sql_stats_automatic_partial_collection_fraction_stale_rows` to 1.0
Michael Erickson contributed helpful insights:
See
#147443 (comment)
for calculations that led to the number selection.
There was an additional discussion on this PR regarding setting static
stats, that was also rejected since the queries running on these
tables are varied and complex.
See #151502 (review)
Resolves: #147443
Epic: None
Release note: None
Co-authored-by: David Hartunian <davidh@cockroachlabs.com>File tree
12 files changed
+223
-36
lines changed- docs/generated/settings
- pkg
- clusterversion
- sql
- catalog
- bootstrap/testdata
- systemschema_test/testdata
- systemschema
- logictest/testdata/logic_test
- upgrade/upgrades
12 files changed
+223
-36
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
421 | 421 | | |
422 | 422 | | |
423 | 423 | | |
424 | | - | |
| 424 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
379 | 379 | | |
380 | 380 | | |
381 | 381 | | |
382 | | - | |
| 382 | + | |
383 | 383 | | |
384 | 384 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
222 | 222 | | |
223 | 223 | | |
224 | 224 | | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
225 | 230 | | |
226 | 231 | | |
227 | 232 | | |
| |||
281 | 286 | | |
282 | 287 | | |
283 | 288 | | |
| 289 | + | |
| 290 | + | |
284 | 291 | | |
285 | 292 | | |
286 | 293 | | |
| |||
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
702 | 702 | | |
703 | 703 | | |
704 | 704 | | |
705 | | - | |
| 705 | + | |
706 | 706 | | |
707 | 707 | | |
708 | 708 | | |
| |||
751 | 751 | | |
752 | 752 | | |
753 | 753 | | |
754 | | - | |
| 754 | + | |
755 | 755 | | |
756 | 756 | | |
757 | 757 | | |
| |||
1421 | 1421 | | |
1422 | 1422 | | |
1423 | 1423 | | |
1424 | | - | |
| 1424 | + | |
1425 | 1425 | | |
1426 | 1426 | | |
1427 | 1427 | | |
| |||
3380 | 3380 | | |
3381 | 3381 | | |
3382 | 3382 | | |
| 3383 | + | |
| 3384 | + | |
| 3385 | + | |
| 3386 | + | |
3383 | 3387 | | |
3384 | 3388 | | |
3385 | 3389 | | |
| |||
3604 | 3608 | | |
3605 | 3609 | | |
3606 | 3610 | | |
| 3611 | + | |
| 3612 | + | |
| 3613 | + | |
| 3614 | + | |
3607 | 3615 | | |
3608 | 3616 | | |
3609 | 3617 | | |
| |||
Lines changed: 11 additions & 11 deletions
Large diffs are not rendered by default.
Lines changed: 11 additions & 11 deletions
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
133 | 133 | | |
134 | 134 | | |
135 | 135 | | |
136 | | - | |
| 136 | + | |
137 | 137 | | |
138 | 138 | | |
139 | 139 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| 23 | + | |
23 | 24 | | |
24 | 25 | | |
25 | 26 | | |
| |||
87 | 88 | | |
88 | 89 | | |
89 | 90 | | |
| 91 | + | |
90 | 92 | | |
91 | 93 | | |
92 | 94 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
103 | 103 | | |
104 | 104 | | |
105 | 105 | | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
106 | 114 | | |
107 | 115 | | |
108 | 116 | | |
| |||
0 commit comments