删除表后Redshift回收磁盘空间

时间:2015-02-06 11:36:33

标签: amazon-redshift

删除表后,redshift会回收可用磁盘空间,还是需要运行真空。

1 个答案:

答案 0 :(得分:5)

drop table释放空间。

如果你正在对表行执行删除操作,那么你应该只启动vaccumm delete only命令。

如果在红移中掉落表,则无需点火;

触发命令以检查表下降之前和之后的DB大小,以查看是否获得空间

select sum(mbytes)/1024 as db_size_in_gb, database from (
select trim(pgdb.datname) as Database,
trim(a.name) as Table, b.mbytes
from stv_tbl_perm a
join pg_database as pgdb on pgdb.oid = a.db_id
join (select tbl, count(*) as mbytes
from stv_blocklist group by tbl) b on a.id=b.tbl
where a.slice=0
order by db_id, name)
group by database;