forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit4460964
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 parentfe65f59 commit4460964
1 file changed
+37
-16
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
211 | 211 | | |
212 | 212 | | |
213 | 213 | | |
214 | | - | |
215 | | - | |
216 | | - | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
217 | 217 | | |
218 | 218 | | |
219 | 219 | | |
| |||
2316 | 2316 | | |
2317 | 2317 | | |
2318 | 2318 | | |
| 2319 | + | |
2319 | 2320 | | |
| 2321 | + | |
2320 | 2322 | | |
2321 | 2323 | | |
2322 | 2324 | | |
| |||
2341 | 2343 | | |
2342 | 2344 | | |
2343 | 2345 | | |
2344 | | - | |
2345 | | - | |
2346 | | - | |
| 2346 | + | |
| 2347 | + | |
| 2348 | + | |
| 2349 | + | |
| 2350 | + | |
| 2351 | + | |
| 2352 | + | |
| 2353 | + | |
| 2354 | + | |
| 2355 | + | |
| 2356 | + | |
| 2357 | + | |
| 2358 | + | |
| 2359 | + | |
| 2360 | + | |
| 2361 | + | |
| 2362 | + | |
2347 | 2363 | | |
2348 | 2364 | | |
2349 | 2365 | | |
| |||
2379 | 2395 | | |
2380 | 2396 | | |
2381 | 2397 | | |
| 2398 | + | |
| 2399 | + | |
| 2400 | + | |
| 2401 | + | |
| 2402 | + | |
| 2403 | + | |
| 2404 | + | |
| 2405 | + | |
| 2406 | + | |
| 2407 | + | |
2382 | 2408 | | |
2383 | 2409 | | |
2384 | 2410 | | |
| |||
2395 | 2421 | | |
2396 | 2422 | | |
2397 | 2423 | | |
| 2424 | + | |
| 2425 | + | |
| 2426 | + | |
2398 | 2427 | | |
2399 | 2428 | | |
2400 | 2429 | | |
2401 | 2430 | | |
2402 | | - | |
2403 | | - | |
2404 | | - | |
2405 | | - | |
2406 | | - | |
2407 | | - | |
2408 | | - | |
2409 | | - | |
2410 | 2431 | | |
2411 | 2432 | | |
2412 | 2433 | | |
| |||
2521 | 2542 | | |
2522 | 2543 | | |
2523 | 2544 | | |
2524 | | - | |
| 2545 | + | |
2525 | 2546 | | |
2526 | 2547 | | |
2527 | | - | |
| 2548 | + | |
2528 | 2549 | | |
2529 | 2550 | | |
2530 | 2551 | | |
| |||
0 commit comments
Comments
(0)