Query below allows to get names of ten largest tables in database.
Query
select schema_name as table_schema,
anchor_table_name as table_name,
round(sum(used_bytes)/(1024^2), 2) as used_mb
from v_monitor.storage_containers sc
join v_catalog.projections p
on sc.projection_id = p.projection_id
group by table_schema,
table_name
order by used_mb desc
limit 10;
Columns
- table_schema - schema in which table reside
- table_name - name of the table
- used_mb - sum of all table's projections size (table size)
Rows
- One row represents one table in a database
- Scope of rows: top 10 largest tables by size
- Ordered by table used space descending