Postgres manual vacuum and auto vacuum running on the same table

autovacuumpostgresqlvacuum

I kicked off a manual vacuum on a 19TB table we have been having problems with 18 days ago.

Since then I have discovered that the auto vacuum for this also has triggered and is on wait_event = relation

I presume that they conflict with each other and if so would it be advisable to kill the auto vacuum or the manual vacuum? I was going to kill the auto vacuum but thought it best to post here…as presumably the manual vacuum has made more headway over 18 days

Thx

Best Answer

There can only be a single VACUUM running on a table at any given time. If you start two, the second will be blocked until the first is done. You can safely kill the autovacuum process that is waiting for the lock. On the other hand, if you kill the process, it will come back withing the minute, so you might as well let it hang there.