List tables by their size in Redshift

Query below returns tables in a database with space they use ordered from the ones using most.

Query

SELECT  schema as table_schema,
        "table" as table_name,
        size as used_mb
FROM svv_table_info d
order by size desc;

Columns

  • table_schema - name of schema
  • table_name - name of table
  • used_mb - size of the table, in 1 MB data blocks.

Rows

  • One row represents one table in a database
  • Scope of rows: all tables in a database
  • Ordered by table size, from largest to smallest

Sample results

0
There are no comments. Click here to write the first comment.