Simon Riggs <simon@xxxxxxxxxxxxxxx> writes: > On Mon, 29 Apr 2019 at 22:02, John Lumby <johnlumby@xxxxxxxxxxx> wrote: >> If a regular backend worker becomes blocked waiting for a lock held by an >> autovacuum worker, >> then , depending on some decision made by deadlock detector, >> the autovacuum worker may be signalled to terminate >> Is there any configuration parameter which controls this? >> including deferring or even completely eliminating this cancelling? > Why would you want this? > If the autovacuum is cancelled, it will re-execute again in the near > future, once your interrupting SQL has released locks. I think the OP is looking for the opposite, ie prevent autovacuum from being kicked off the lock. It already is resistant to that if we're doing an anti-wraparound vacuum, so maybe the simplest answer is to tighten up autovacuum_freeze_max_age. (Whether that's a good idea is a different question.) Or you could just launch a manual vacuum. regards, tom lane