根据 AWS 文档:
Amazon Redshift does not automatically reclaim and reuse space that is freed when you delete rows and update rows.
在运行 VACUUM 之前,有没有办法知道或评估 VACUUM 将从磁盘释放多少空间?
谢谢
引用资料:
http://docs.aws.amazon.com/redshift/latest/dg/t_Reclaiming_storage_space202.html http://docs.aws.amazon.com/redshift/latest/dg/r_VACUUM_command.html
最佳答案
您可以通过查找 svv_table_info 中的 tbl_rows 列来计算将从 vacuum 命令中释放的存储量。看法。这包括标记为删除的行。将其与同一张表中的 select count(*) 进行比较,您将得到一个比率。在名为 factsales 的理论表上有类似的东西。
select (select cast(count(*) as numeric(12,0)) from factsales) /
cast(tbl_rows as numeric(12,0))
as "percentage of non deleted rows"
from svv_table_info where "table" = 'factsales'
似乎没有一种直接的方法来执行动态 SQL 和游标,因此要在所有表中获得相同的比率,您必须从外部源或编程语言(即 python)执行代码。
关于amazon-redshift - 评估 Redshift 中的 VACUUM 将释放多少空间,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34395413/