forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit38f7831
committed
Avoid holding AutovacuumScheduleLock while rechecking table statistics.
In databases with many tables, re-fetching the statistics takes some time,so that this behavior seriously decreases the available concurrency formultiple autovac workers. There's discussion afoot about more completefixes, but a simple and back-patchable amelioration is to claim the tableand release the lock before rechecking stats. If we find out there's nolonger a reason to process the table, re-taking the lock to un-claim thetable is cheap enough.(This patch is quite old, but got lost amongst a discussion of moreaggressive fixes. It's not clear when or if such a fix will beaccepted, but in any case it'd be unlikely to get back-patched.Let's do this now so we have some improvement for the back branches.)In passing, make the normal un-claim step take AutovacuumScheduleLocknot AutovacuumLock, since that is what is documented to protect thewi_tableoid field. This wasn't an actual bug in view of the fact thatreaders of that field hold both locks, but it creates some concurrencypenalty against operations that need only AutovacuumLock.Back-patch to all supported versions.Jeff JanesDiscussion:https://postgr.es/m/26118.1520865816@sss.pgh.pa.us1 parentb32fad5 commit38f7831
1 file changed
+37
-16
lines changedLines changed: 37 additions & 16 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
212 | 212 |
| |
213 | 213 |
| |
214 | 214 |
| |
215 |
| - | |
216 |
| - | |
217 |
| - | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
218 | 218 |
| |
219 | 219 |
| |
220 | 220 |
| |
| |||
2317 | 2317 |
| |
2318 | 2318 |
| |
2319 | 2319 |
| |
| 2320 | + | |
2320 | 2321 |
| |
| 2322 | + | |
2321 | 2323 |
| |
2322 | 2324 |
| |
2323 | 2325 |
| |
| |||
2342 | 2344 |
| |
2343 | 2345 |
| |
2344 | 2346 |
| |
2345 |
| - | |
2346 |
| - | |
2347 |
| - | |
| 2347 | + | |
| 2348 | + | |
| 2349 | + | |
| 2350 | + | |
| 2351 | + | |
| 2352 | + | |
| 2353 | + | |
| 2354 | + | |
| 2355 | + | |
| 2356 | + | |
| 2357 | + | |
| 2358 | + | |
| 2359 | + | |
| 2360 | + | |
| 2361 | + | |
| 2362 | + | |
| 2363 | + | |
2348 | 2364 |
| |
2349 | 2365 |
| |
2350 | 2366 |
| |
| |||
2380 | 2396 |
| |
2381 | 2397 |
| |
2382 | 2398 |
| |
| 2399 | + | |
| 2400 | + | |
| 2401 | + | |
| 2402 | + | |
| 2403 | + | |
| 2404 | + | |
| 2405 | + | |
| 2406 | + | |
| 2407 | + | |
| 2408 | + | |
2383 | 2409 |
| |
2384 | 2410 |
| |
2385 | 2411 |
| |
| |||
2396 | 2422 |
| |
2397 | 2423 |
| |
2398 | 2424 |
| |
| 2425 | + | |
| 2426 | + | |
| 2427 | + | |
2399 | 2428 |
| |
2400 | 2429 |
| |
2401 | 2430 |
| |
2402 | 2431 |
| |
2403 |
| - | |
2404 |
| - | |
2405 |
| - | |
2406 |
| - | |
2407 |
| - | |
2408 |
| - | |
2409 |
| - | |
2410 |
| - | |
2411 | 2432 |
| |
2412 | 2433 |
| |
2413 | 2434 |
| |
| |||
2522 | 2543 |
| |
2523 | 2544 |
| |
2524 | 2545 |
| |
2525 |
| - | |
| 2546 | + | |
2526 | 2547 |
| |
2527 | 2548 |
| |
2528 |
| - | |
| 2549 | + | |
2529 | 2550 |
| |
2530 | 2551 |
| |
2531 | 2552 |
| |
|
0 commit comments
Comments
(0)