gpt4 book ai didi

postgresql - VACUUM FULL 表所需的空间

转载 作者:行者123 更新时间:2023-11-29 11:34:52 27 4
gpt4 key购买 nike

来自 PostgreSQL 10.4 手册中关于完全真空的内容:

Note that they also temporarily use extra disk space approximately equal to the size of the table, since the old copies of the table and indexes can't be released until the new ones are complete

我在许多不同的地方读过这篇文章,并以各种方式表达。有些表明所需的空间最多等于被清理的表的大小。暗示它可能只需要足够的空间来存储生成的真空表,即大小在 [0-size_of_original_table] 范围内,具体取决于表中有多少死行。

我的问题是:对表进行完全清理是否总是需要与原始表大小相等的空间,还是取决于表中事件行的数量?

最佳答案

VACUUM (FULL) 所需的额外空间取决于表中事件 行的数量。

VACUUM (FULL) 期间发生的事情是写入表的新副本。所有活元组(= 行版本)和无法删除的死元组都将写入此新副本。

交易完成后,旧副本将被删除。

关于postgresql - VACUUM FULL 表所需的空间,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51361463/

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