gpt4 book ai didi

postgresql - 真空满后释放内存?

转载 作者:行者123 更新时间:2023-11-29 12:54:18 29 4
gpt4 key购买 nike

我的数据库服务器上的磁盘空间不足。我从未执行过 vacuum full,我希望 vacuum full 可以释放一些空间。

您之前是否运行过vacuum full,如果释放了空间,它有多少?

最佳答案

physically vacuum full 制作一个表的副本并销毁旧表。这导致了几个结论:

  • 如果空间不足,您可能无法运行它
  • 您将释放与删除的元组占用的空间一样多的空间

https://www.postgresql.org/docs/current/static/sql-vacuum.html

This method also requires extra disk space, since it writes a new copy of the table and doesn't release the old copy until the operation is complete. Usually this should only be used when a significant amount of space needs to be reclaimed from within the table.

您可以通过获取数据的恢复副本来无间隙地找出数据的大小,例如 pg_dump/pg_restore

关于postgresql - 真空满后释放内存?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47153160/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com