PostgreSQL: VACCUM FULL vs pg_dump and restore

狂风中的少年 提交于 2019-12-12 22:29:56

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!