问题
Does pg_dump do the same thing as VACCUM FULL? I wan to clean a database at night but VACCUM FULL takes too much time. Does pg_dump also clear database form unwanted data?
回答1:
Assuming that you create a new database and restore the dump, the effect of both operations would be pretty much the same.
The big question is why you think you need such extreme measures. Normally autovacuum should take care of dead tuples, and if you have a table on which you perform bulk updates or deletes, you might consider using VACUUM (FULL)
on that table only.
来源:https://stackoverflow.com/questions/48951416/postgresql-vaccum-full-vs-pg-dump-and-restore