Postgresql – VACUUM FULL restored very small amount of disk space

postgresqlpostgresql-10

I have a large table with ~130m entries. I recently removed unnecessary entries and it should be left with ~60m.

I ran VACUUM(FULL) [table_name] and after it finally finished it restored only 2GB of disk space, while I expected it to be ~20GB. Also it seems that only 10m entries were removed after vacuuming. The VACUUM(FULL) finished successfuly and it had enough disk space.

What could cause this? Can this occupied space be recovered somehow?

Best Answer

If there is an open snapshot that can theoretically still see the deleted data, then that data has to be copied over into the new table by VACUUM FULL. Check pg_stat_activity.