- Notifications
You must be signed in to change notification settings - Fork4.9k
Commit4b0e717
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 parent44a36a8 commit4b0e717
1 file changed
+37
-16
lines changedLines changed: 37 additions & 16 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
209 | 209 |
| |
210 | 210 |
| |
211 | 211 |
| |
212 |
| - | |
213 |
| - | |
214 |
| - | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
215 | 215 |
| |
216 | 216 |
| |
217 | 217 |
| |
| |||
2197 | 2197 |
| |
2198 | 2198 |
| |
2199 | 2199 |
| |
| 2200 | + | |
2200 | 2201 |
| |
| 2202 | + | |
2201 | 2203 |
| |
2202 | 2204 |
| |
2203 | 2205 |
| |
| |||
2222 | 2224 |
| |
2223 | 2225 |
| |
2224 | 2226 |
| |
2225 |
| - | |
2226 |
| - | |
2227 |
| - | |
| 2227 | + | |
| 2228 | + | |
| 2229 | + | |
| 2230 | + | |
| 2231 | + | |
| 2232 | + | |
| 2233 | + | |
| 2234 | + | |
| 2235 | + | |
| 2236 | + | |
| 2237 | + | |
| 2238 | + | |
| 2239 | + | |
| 2240 | + | |
| 2241 | + | |
| 2242 | + | |
| 2243 | + | |
2228 | 2244 |
| |
2229 | 2245 |
| |
2230 | 2246 |
| |
| |||
2260 | 2276 |
| |
2261 | 2277 |
| |
2262 | 2278 |
| |
| 2279 | + | |
| 2280 | + | |
| 2281 | + | |
| 2282 | + | |
| 2283 | + | |
| 2284 | + | |
| 2285 | + | |
| 2286 | + | |
| 2287 | + | |
| 2288 | + | |
2263 | 2289 |
| |
2264 | 2290 |
| |
2265 | 2291 |
| |
| |||
2276 | 2302 |
| |
2277 | 2303 |
| |
2278 | 2304 |
| |
| 2305 | + | |
| 2306 | + | |
| 2307 | + | |
2279 | 2308 |
| |
2280 | 2309 |
| |
2281 | 2310 |
| |
2282 | 2311 |
| |
2283 |
| - | |
2284 |
| - | |
2285 |
| - | |
2286 |
| - | |
2287 |
| - | |
2288 |
| - | |
2289 |
| - | |
2290 |
| - | |
2291 | 2312 |
| |
2292 | 2313 |
| |
2293 | 2314 |
| |
| |||
2397 | 2418 |
| |
2398 | 2419 |
| |
2399 | 2420 |
| |
2400 |
| - | |
| 2421 | + | |
2401 | 2422 |
| |
2402 | 2423 |
| |
2403 |
| - | |
| 2424 | + | |
2404 | 2425 |
| |
2405 | 2426 |
| |
2406 | 2427 |
| |
|
0 commit comments
Comments
(0)