Quote:
Originally Posted by n_i
Does not account for the size of indexes; are they part of a schema?
|
Oh right DUH

like it would be that easy. Yes you would have to multiply NLEAF times page size then add the two together. What I get for hurrying.
You may be able to modify this query to suit your needs as it will find the index size for 1 table.
Code:
SELECT DEC(( FLOAT(( Sum(CAST(nleaf AS BIGINT)) * x.pagesize )) /
FLOAT(( 1024 * 1024 )) ), 8, 3) "Index_size_in_MBs"
FROM syscat.indexes i,
(SELECT s.tabschema,
s.tabname,
st.pagesize
FROM syscat.tables s,
sysibm.systablespaces st
WHERE s.index_tbspace = st.tbspace) AS x
WHERE x.tabname = i.tabname
AND i.tabname = 'YOUR_TABLE_NAME'
GROUP BY x.pagesize