1

I'm new to PostgreSQL, I know about the concept of vacuum in database.

But I want to the major advantages and disadvantages of vacuuming process. Also I want to know:

  1. What happen if I access the table while vacuuming full database?
  2. Whether it will affect the table, or cause data loss?
1

Vacuum is an inherent part of Postgres due to the MVCC model - you don't have much choice, it's there.

As for vacuum full - it rewrites the table and takes an exclusive lock in the process- you won't be able to access your table.

It sounds bad but recent releases reduced the need for vacuum full dramatically. Frequent regular vacuum (using the autovacuum for example) should be enough in most cases. Just make sure to monitor your vacuuming and DB for bloat.

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.