forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit7d71d3d
committed
Refresh cost-based delay params more frequently in autovacuum
Allow autovacuum to reload the config file more often so that cost-baseddelay parameters can take effect while VACUUMing a relation. Previously,autovacuum workers only reloaded the config file once per relationvacuumed, so config changes could not take effect until beginning tovacuum the next table.Now, check if a reload is pending roughly once per block, when checkingif we need to delay.In order for autovacuum workers to safely update their own cost delayand cost limit parameters without impacting performance, we had torethink when and how these values were accessed.Previously, an autovacuum worker's wi_cost_limit was set only at thebeginning of vacuuming a table, after reloading the config file.Therefore, at the time that autovac_balance_cost() was called, workersvacuuming tables with no cost-related storage parameters could stillhave different values for their wi_cost_limit_base and wi_cost_delay.Now that the cost parameters can be updated while vacuuming a table,workers will (within some margin of error) have no reason to havedifferent values for cost limit and cost delay (in the absence ofcost-related storage parameters). This removes the rationale for keepingcost limit and cost delay in shared memory. Balancing the cost limitrequires only the number of active autovacuum workers vacuuming a tablewith no cost-based storage parameters.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 parenta85c60a commit7d71d3d
File tree
5 files changed
+219
-122
lines changed- src
- backend
- access/heap
- commands
- postmaster
- include/commands
5 files changed
+219
-122
lines changedLines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
389 | 389 |
| |
390 | 390 |
| |
391 | 391 |
| |
392 |
| - | |
| 392 | + | |
393 | 393 |
| |
394 | 394 |
| |
395 | 395 |
| |
|
Lines changed: 42 additions & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
48 | 48 |
| |
49 | 49 |
| |
50 | 50 |
| |
| 51 | + | |
51 | 52 |
| |
52 | 53 |
| |
53 | 54 |
| |
| |||
523 | 524 |
| |
524 | 525 |
| |
525 | 526 |
| |
526 |
| - | |
527 | 527 |
| |
528 |
| - | |
| 528 | + | |
| 529 | + | |
529 | 530 |
| |
530 | 531 |
| |
531 | 532 |
| |
| |||
579 | 580 |
| |
580 | 581 |
| |
581 | 582 |
| |
| 583 | + | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
582 | 589 |
| |
583 | 590 |
| |
584 | 591 |
| |
585 | 592 |
| |
586 | 593 |
| |
587 | 594 |
| |
| 595 | + | |
| 596 | + | |
588 | 597 |
| |
589 | 598 |
| |
590 | 599 |
| |
| |||
2245 | 2254 |
| |
2246 | 2255 |
| |
2247 | 2256 |
| |
2248 |
| - | |
| 2257 | + | |
| 2258 | + | |
| 2259 | + | |
| 2260 | + | |
| 2261 | + | |
| 2262 | + | |
| 2263 | + | |
| 2264 | + | |
| 2265 | + | |
| 2266 | + | |
| 2267 | + | |
| 2268 | + | |
| 2269 | + | |
| 2270 | + | |
| 2271 | + | |
| 2272 | + | |
| 2273 | + | |
| 2274 | + | |
| 2275 | + | |
| 2276 | + | |
| 2277 | + | |
| 2278 | + | |
2249 | 2279 |
| |
2250 | 2280 |
| |
2251 | 2281 |
| |
| |||
2278 | 2308 |
| |
2279 | 2309 |
| |
2280 | 2310 |
| |
2281 |
| - | |
| 2311 | + | |
| 2312 | + | |
| 2313 | + | |
| 2314 | + | |
| 2315 | + | |
| 2316 | + | |
| 2317 | + | |
| 2318 | + | |
| 2319 | + | |
2282 | 2320 |
| |
2283 | 2321 |
| |
2284 | 2322 |
| |
|
Lines changed: 0 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
995 | 995 |
| |
996 | 996 |
| |
997 | 997 |
| |
998 |
| - | |
999 | 998 |
| |
1000 | 999 |
| |
1001 | 1000 |
| |
|
0 commit comments
Comments
(0)