How find table size and other important information in Redshift

Like any other database, finding table size and other important information is part of day to day activities of a database administrator or developer. Especially you can use this information to find large unsorted table’s to safe storage space and optimize Redshift Cluster.

You can use following query to find large unsorted tables with more than 50% unsorted rows and percentage used by these tables. These tables are good target for vacuum or deep table copy.  

SELECT  "schema","table", size, tbl_rows,unsorted,pct_used FROM SVV_TABLE_INFO where unsorted > 50  order by 3 desc