Question

I am new to DB2.

I am trying to determine the average row length in bytes for a number of tables (TABLE_1, TABLE_2, TABLE_3, TABLE_4 and TABLE_5). I need to do some analysis on the size of the tables and then to extrapolate the information I get.

I have a script which shows me the number of rows for a given table:

SELECT (data_object_p_size + index_object_p_size + long_object_p_size + 
   lob_object_p_size + xml_object_p_size) as total_p_size 
   FROM TABLE( SYSPROC.ADMIN_GET_TAB_INFO_V97( 'SCHEMA', 'TABLE_1' )) AS T;

But I can not find anywhere information to get the average row length. I also have access to IBM Data Studio.

Was it helpful?

Solution

After collecting the table statistics (e.g. using the RUNSTATS command) you can

select avgrowsize from syscat.tables
 where tabschema = 'YOURSCHEMA' and tabname = 'YOURTABLE'
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top