可以了解下vacuum和vacuum full的功能,他可以帮助你。
英文文档:http://postgres.cn/docs/12/sql-vacuum.html
中文文档:http://postgres.cn/docs/12/sql-vacuum.html