Tag Archives: vertica

How to list Vertica Tables by number of rows ?

When working with Vertica, you may need to find out which tables have the largest number of rows. To do so, you must tap into the storage_containers system table, that will give metrics about the number of rows, AND the number of deleted rows. But since containers are distributed, you will need to aggregate this data, and ensure to limit your query to the super-projection, which guarantee to contain all table info. In brief :

with num_rows as (
    select schema_name,
           anchor_table_name as table_name,
           sum(total_row_count - deleted_row_count) as rows
    from v_monitor.storage_containers sc
    join v_catalog.projections p
         on sc.projection_id = p.projection_id
         and p.is_super_projection = true
    group by schema_name,
             table_name,
             sc.projection_id
)
select schema_name,
       table_name,
       max(rows) as rows
from num_rows
group by schema_name,
         table_name
order by rows desc;

How to find a Vertica database last good epoch ?

If you need to check if your Vertica ROS is lagging behind your WOS, you can use the following query to retrieve the last good epoch (i.e : the last one written to disk, which ensures you won’t lose any data even in the case of a catastrophic failure where all your nodes would shut down simultaneously) :

SELECT epoch_number, epoch_close_time
FROM v_monitor.system
JOIN epochs dbadmin ON epoch_number = last_good_epoch;

How to fix Vertica error “Attempted to create too many ROS containers for projection” ?

While loading data into the HPE Vertica database, you may run into this issue :

[code lang=SQL]
[Vertica][VJDBC](2245) ERROR: Attempted to create too many ROS containers for projection x.y
[/code]

You may also notice that the error disapears if you wait a few minutes before restarting your data loading process. Only to reappear a little while later.

The issue comes from the vertica Read Optimized Store (ROS).

When loading data into Vertica, Continue reading