Commit a85c60a
committed
Separate vacuum cost variables from GUCs
Vacuum code run both by autovacuum workers and a backend doing
VACUUM/ANALYZE previously inspected VacuumCostLimit and VacuumCostDelay,
which are the global variables backing the GUCs vacuum_cost_limit and
vacuum_cost_delay.
Autovacuum workers needed to override these variables with their
own values, derived from autovacuum_vacuum_cost_limit and
autovacuum_vacuum_cost_delay and worker cost limit balancing logic.
This led to confusing code which, in some cases, both derived and
set a new value of VacuumCostLimit from VacuumCostLimit.
In preparation for refreshing these GUC values more often, introduce
new, independent global variables and add a function to update them
using the GUCs and existing logic.
Per suggestion by Kyotaro Horiguchi
Author: Melanie Plageman <melanieplageman@gmail.com>
Reviewed-by: Masahiko Sawada <sawada.mshk@gmail.com>
Reviewed-by: Daniel Gustafsson <daniel@yesql.se>
Reviewed-by: Kyotaro Horiguchi <horikyota.ntt@gmail.com>
Reviewed-by: Robert Haas <robertmhaas@gmail.com>
Discussion: https://www.postgresql.org/message-id/flat/CAAKRu_ZngzqnEODc7LmS1NH04Kt6Y9huSjz5pp7%2BDXhrjDA0gw%40mail.gmail.com1 parent 71a8251 commit a85c60a
File tree
5 files changed
+40
-34
lines changed- src
- backend
- commands
- postmaster
- include
- commands
- postmaster
5 files changed
+40
-34
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
72 | 72 | | |
73 | 73 | | |
74 | 74 | | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
75 | 84 | | |
76 | 85 | | |
77 | 86 | | |
| |||
514 | 523 | | |
515 | 524 | | |
516 | 525 | | |
| 526 | + | |
517 | 527 | | |
518 | | - | |
| 528 | + | |
519 | 529 | | |
520 | 530 | | |
521 | 531 | | |
| |||
2244 | 2254 | | |
2245 | 2255 | | |
2246 | 2256 | | |
2247 | | - | |
2248 | | - | |
| 2257 | + | |
| 2258 | + | |
2249 | 2259 | | |
2250 | 2260 | | |
2251 | 2261 | | |
2252 | 2262 | | |
2253 | | - | |
2254 | | - | |
| 2263 | + | |
| 2264 | + | |
2255 | 2265 | | |
2256 | 2266 | | |
2257 | 2267 | | |
| |||
2268 | 2278 | | |
2269 | 2279 | | |
2270 | 2280 | | |
2271 | | - | |
2272 | | - | |
| 2281 | + | |
2273 | 2282 | | |
2274 | 2283 | | |
2275 | 2284 | | |
| |||
2319 | 2328 | | |
2320 | 2329 | | |
2321 | 2330 | | |
2322 | | - | |
2323 | | - | |
| 2331 | + | |
| 2332 | + | |
2324 | 2333 | | |
2325 | 2334 | | |
2326 | | - | |
| 2335 | + | |
2327 | 2336 | | |
2328 | 2337 | | |
2329 | 2338 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
995 | 995 | | |
996 | 996 | | |
997 | 997 | | |
998 | | - | |
| 998 | + | |
| 999 | + | |
999 | 1000 | | |
1000 | 1001 | | |
1001 | 1002 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1773 | 1773 | | |
1774 | 1774 | | |
1775 | 1775 | | |
1776 | | - | |
1777 | | - | |
| 1776 | + | |
| 1777 | + | |
| 1778 | + | |
| 1779 | + | |
1778 | 1780 | | |
1779 | 1781 | | |
1780 | | - | |
| 1782 | + | |
1781 | 1783 | | |
1782 | 1784 | | |
1783 | 1785 | | |
1784 | | - | |
1785 | | - | |
| 1786 | + | |
| 1787 | + | |
| 1788 | + | |
| 1789 | + | |
| 1790 | + | |
| 1791 | + | |
| 1792 | + | |
| 1793 | + | |
1786 | 1794 | | |
1787 | 1795 | | |
1788 | 1796 | | |
| |||
2311 | 2319 | | |
2312 | 2320 | | |
2313 | 2321 | | |
2314 | | - | |
2315 | | - | |
2316 | 2322 | | |
2317 | 2323 | | |
2318 | 2324 | | |
| |||
2415 | 2421 | | |
2416 | 2422 | | |
2417 | 2423 | | |
2418 | | - | |
2419 | | - | |
2420 | | - | |
2421 | | - | |
2422 | | - | |
2423 | | - | |
2424 | | - | |
2425 | | - | |
2426 | 2424 | | |
2427 | 2425 | | |
2428 | 2426 | | |
| |||
2436 | 2434 | | |
2437 | 2435 | | |
2438 | 2436 | | |
2439 | | - | |
| 2437 | + | |
2440 | 2438 | | |
2441 | 2439 | | |
2442 | 2440 | | |
| |||
2533 | 2531 | | |
2534 | 2532 | | |
2535 | 2533 | | |
2536 | | - | |
2537 | | - | |
2538 | | - | |
2539 | | - | |
2540 | 2534 | | |
2541 | 2535 | | |
2542 | 2536 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
307 | 307 | | |
308 | 308 | | |
309 | 309 | | |
| 310 | + | |
| 311 | + | |
310 | 312 | | |
311 | 313 | | |
312 | 314 | | |
| |||
347 | 349 | | |
348 | 350 | | |
349 | 351 | | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
350 | 355 | | |
351 | 356 | | |
352 | 357 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | 66 | | |
70 | 67 | | |
71 | 68 | | |
| |||
0 commit comments