How to calculate bytes used for individual table rows?

Moderator: NorbertKrupa

Post Reply
User avatar
Josh
Intermediate
Intermediate
Posts: 106
Joined: Thu Jan 26, 2012 9:38 pm

How to calculate bytes used for individual table rows?

Post by Josh » Fri Jun 19, 2015 5:46 pm

Hello,

Is there a way to get the exact bytes used by a particular row from a table? Not the average, but the exact?

I think I know how to get the average bytes used per row:

Code: Select all

dbadmin=> select * from t;
   c1   |  c2   
--------+-------
 1234   | 5
 123456 | 78
 123456 | 78910
(3 rows)

dbadmin=> select sum(used_bytes), avg(row_count), sum(used_bytes) / avg(row_count) from projection_storage where anchor_table_name = 't';
 sum | avg | ?column? 
-----+-----+----------
 123 |   3 |       41
(1 row)

dbadmin=> select sum(used_bytes), avg(row_count), sum(used_bytes) / avg(row_count) avg_row_used_bytes from projection_storage where anchor_table_name = 't';
 sum | avg | avg_row_used_bytes 
-----+-----+--------------------
 123 |   3 |                 41
(1 row)
But I would like to see the actual bytes used per row :)

Thank you.
Thank you!
Joshua

Post Reply

Return to “Vertica SQL”