Get the latest tech news
Postgres Bloat Minimization
Understanding and minimizing Postgres table bloat
Vacuum goes through all table files looking for row versions that were updated or deleted by already completed transactions and frees the space on the pages. A good recipe when this happens is to cancel all the open transactions and run VACUUM for a table manually (or wait until the next autovacuum comes for it). Long open transactions Stuck locks Insufficient resources allocated to vacuuming Space not freed on a filesystem level after massive table modifications
Or read this on Hacker News