Reputation: 383
After dropping a table ,does redshift reclaim the free disk space ,or do we need to run vaccum.
Upvotes: 4
Views: 6427
Reputation: 2305
drop table release the space.
if you are doing delete operation for rows of table then you should fire vaccumm delete only command.
No need to fire vaccum in case of drop table in redshift
Fire below command to check DB size before and after table drop to see if gains space
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;
Upvotes: 6