DB2 запрашивает, чтобы проверить размер таблицы
select
a.CARD*(sum(b.AVGCOLLEN)+10)/1024/1024 as Tablesize_in_MB
from
syscat.tables as a, syscat.columns as b
where
a.TABNAME = b.TABNAME and b.TABNAME = 'TABLE_NAME' group by a.CARD
размер данных
select
char(date(t.stats_time))||' '||char(time(t.stats_time)) as statstime
,substr(t.tabschema,1,8)||'.'||substr(t.tabname,1,24) as tabname
,card as rows_per_table
,decimal(float(t.npages)/ ( 1024 / (b.pagesize/1024)),9,2) as used_mb
,decimal(float(t.fpages)/ ( 1024 / (b.pagesize/1024)),9,2) as allocated_mb
from
syscat.tables t , syscat.tablespaces b
where t.tbspace=b.tbspace
order by 5 desc with ur
размер индекса
select
rtrim(substr(i.tabschema,1,8))||'.'||rtrim(substr( i.tabname, 1,24)) as tabname
,decimal(sum(i.nleaf)/( 1024 / (b.pagesize/1024)),12,2) as indx_used_per_table_mb
from
syscat.indexes i, syscat.tables t , syscat.tablespaces b
where
i.tabschema is not null and i.tabname=t.tabname
and i.tabschema=t.tabschema and t.tbspace=b.tbspace
group by
i.tabname,i.tabschema, b.pagesize order by 2 desc with ur