vertica how to show partition size

Viewed 23

Could you help me? There is a vertica cluster (version 12.0). The database has a table for which partitions are configured. The table is large, so I want to delete the oldest partitions, the largest ones. To do this, I need to know the size of each partition. How can I see the size of a partition?

1 Answers

Dose something like this help?

SELECT 
  t.table_schema
, t.table_name
, p.partition_key
, SUM(p.ros_size_bytes) AS ros_size_bytes
FROM TABLES t
JOIN projections pj ON t.table_id = pj.anchor_table_id
JOIN partitions p USING(projection_id)
GROUP BY 1 , 2 , 3 ORDER BY 4 DESC LIMIT 4;
table_schema|table_name  |partition_key|ros_size_bytes
the_schema  |dc_the_table|2021-02-02   |1,556,987,825,392
the_schema  |dc_the_table|2021-02-08   |1,556,987,825,392
the_schema  |dc_the_table|2021-02-01   |1,556,987,825,392
the_schema  |dc_the_table|2021-02-12   |1,556,987,825,392                                                                                                                       
Related