PostgreSQLQuestion 05 of 11
VACUUM vs VACUUM FULL
Answer out loud or in your head first, then compare.
Answer
A plain VACUUM makes the space taken by obsolete row versions available for reuse. It usually doesn't return most of that space to the operating system. Autovacuum does the necessary work automatically.
VACUUM FULL rewrites the table and can shrink its file, but it needs extra space and an ACCESS EXCLUSIVE lock.
To be precise: ANALYZE gathers statistics for the planner; that's a different job, though it can be combined with VACUUM.
Pitfall: long transactions can hold back the removal of old versions. Turning off autovacuum doesn't solve performance problems and can lead to serious ones, including with transaction IDs.
How did it go? Be honest — “Not yet” puts the question on your review list.
Related questions
- VACUUM or VACUUM FULL? — PostgreSQL