Hi,
You can check the table size by running a REORGCHK with update statistics. then one of the values displayed for each column is TSIZE that is the table size so just run runstats for the desire table.
## reorgchk update statistics on table schemaname.urtabname
Remember to update your statistics before you select any value from the syscat tables.
If you check the documentation for REORGCHK it will tell you the formula to calculate TSIZE from syscat tables.
It is calculated by multiplying the number of rows found in the table ie, CARD value from syscat.tables for your table, with the average row lenght. To calculate average row length you have to see the syscat.columns table. Avg row lenght is calculated as sum of avg column length, ie, AVGCOLLEN value from syscat.columns for your table, with a row overhead of 10 per column.
So the formula is CARD*(SUM(AVGCOLLEN)+10)
eg if CARD=9 and sum(avgcollen) is 51 TSIZE is 9*(51+10)=549.
the sql statement for that would be
select a.CARD * (sum(b.AVGCOLLEN)+10) from syscat.tables as a, syscat.columns as b where a.TABNAME ='urtabname' and b.TABNAME = 'urtabname' group by a.CARD
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.