1

I've got a task to work with a 9.6 Postgres DB, and for some reason Autovacuum is disabled.

The database was extremely slow, and after a manual VACUUM it could breathe again.

The point is, why disable Autovaccum? Is there any practical scenario for a small database to have Autovaccum disabled?

  • 2
    There is absolutely no reason to disable it. Whoever did that, did no have a clue on how to properly manage a Postgres database – a_horse_with_no_name Aug 8 at 15:01
  • @a_horse_with_no_name what if you have a db with high load half of the day and almost no use the other half? Wouldn't it be a good idea disable autovacuum and schedule a manual vacuum? – EAmez Aug 9 at 7:08
3

There is no good reason to keep autovacuum disabled in a production database, and you will run into problems if you do that.

It may make sense to disable autovacuum during exceptional operations, where you run a manual vacuum anyway and don't want your performance sapped by a background job, but more often than not such trickery is a premature optimization.

I would run VACUUM (FULL) on the database, followed by VACUUM (ANALYZE). That shoud take care of any damage done.

Then enable autovacuum.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.