Some times we need to know what is our Raw data size that our tables is occupying in HP Vertica.
We already know that Vertica is very good when we talk about data compression and data encoding so the data size that is stored in the projection_storage.used_bytes it holds the value of the data size after the compression or encoding is applied.
I will the StockTransaction_Fact as example.
The Raw data inside the StockTransaction_Fact.dat file has 685M in size.
du -sh StockTransaction_Fact.dat
685M StockTransaction_Fact.tbl
SELECT audit_license_size();
SELECT cast(database_size_bytes /
(SELECT SUM(used_bytes) FROM v_monitor.projection_storage) as numeric(10,3)) as compression_ratio
FROM v_catalog.license_audits
ORDER BY audit_start_timestamp DESC LIMIT 1;
select cast(SUM(used_bytes) / (1024 ^ 3) AS numeric(3,3))AS compressed_space
from projection_storage
where anchor_table_name = 'StockTransaction_Fact';
select cast((compressed_space * compression_ratio)as numeric(10,3)) as raw_size;