4 ms·
Autovacuum essentially runs a regular VACUUM, which helps you prevent new table bloat. However, to avoid locking issues, it does not fully rewrite the table, so
by lfittl 4y ago
Autovacuum essentially runs a regular VACUUM, which helps you prevent new table bloat. However, to avoid locking issues, it does not fully rewrite the table, so it does not remove existing table bloat.
If you want to remove existing table bloat you either need a VACUUM FULL (takes an exclusive lock, impacting your regular workload thus autovacuum doesn't do it), or use an extension that does an online version of that, i.e. pg_repack or pg_squeeze.
Edit: Also, to clarify, with table bloat in this context I mean pages in the table that are not actually needed, but were added to the table previously to store data. Existing pages couldn't be used because rows were still marked as dead, i.e. autovacuum hadn't yet gotten around to clean them up before new data came in.