Redshift Vacuum 无影响

Redshift Vacuum No Impact

我在 AWS Redshift 上有几个大表(约 1/20 亿行)。这些桌子有一个小 pct_unsorted,因为它们每个周末都会被吸尘。由于新记录,pct_unsorted 每天上涨 0.5%。我使用 SVV_TABLESSVV_TABLE_INFO 找出 pct_unsorted 和 vacuum_sort_benefit.

最近,我注意到当我 运行 周末对这些桌子进行 Vacuum 时,它似乎对 pct_unsorted 没有影响。这可能吗?是 SVV_TABLES 和 SVV_TABLE_INFO 不准确吗?还是我的吸尘器什么也没做?

默认情况下,当未排序的百分比大于 5% 时,Vacuum 仅对 table 进行排序。参见:https://docs.aws.amazon.com/redshift/latest/dg/r_VACUUM_command.html

"By default, VACUUM skips the sort phase for any table where more than 95 percent of the table's rows are already sorted. Skipping the sort phase can significantly improve VACUUM performance. To change the default sort or delete threshold for a single table, include the table name and the TO threshold PERCENT parameter when you run VACUUM."

因此,除非您正在更改 VACUUM 命令的“阈值”或未排序的百分比 > 5%,否则该命令不会对您的 table.

进行排序