我在postgres数据库中删除了大量的行,稍后进行了真空分析.
我注意到AWS RDS控制台中的磁盘使用量没有太大变化.
尝试运行查询,基于表大小没有移动太多.
SELECT *,pg_size_pretty(total_bytes) AS total,pg_size_pretty(index_bytes) AS INDEX,pg_size_pretty(toast_bytes) AS toast,pg_size_pretty(table_bytes) AS TABLE FROM ( SELECT *,total_bytes-index_bytes-COALESCE(toast_bytes,0) AS table_bytes FROM ( SELECT c.oid,nspname AS table_schema,relname AS TABLE_NAME,c.reltuples AS row_estimate,pg_total_relation_size(c.oid) AS total_bytes,pg_indexes_size(c.oid) AS index_bytes,pg_total_relation_size(reltoastrelid) AS toast_bytes FROM pg_class c LEFT JOIN pg_namespace n ON n.oid = c.relnamespace WHERE relkind = 'r' ) a ) a order by total_bytes desc;
这是正常的吗?或者磁盘空间根本没有被回收?