469,328 Members | 1,324 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,328 developers. It's quick & easy.

how to caculate the total size of an index?

just feel puzzled. I can know the nleaf and nlevel value from the
catalog info but how can I get the total space occupied by an index?

thank you~

Nov 12 '05 #1
3 2119
I can get some info from control center, but how can I know the total
size of 100+ indexes?

Nov 12 '05 #2
I use the following script:

db2 "select substr(idx.indschema,1,18) as indschema,
substr(idx.indname,1,18) as indname,idx.fullkeycard
as fullkeycard, idx.nleaf as nleaf,tbs.pagesize as
pagesize,(cast(idx.nleaf as bigint) * tbs.pagesize)/1024
as kbytes from syscat.indexes idx,syscat.tablespaces tbs where
idx.tbspaceid = tbs.tbspaceid and
idx.indschema = '<idxschema>' and idx.indname = '<idxname>'"

and idx.indname in ('ind1','ind2',...)

Nov 12 '05 #3
Bohne, thanks for your scripts.

nleaf indicates the number of leafies, but for an index, there's
non-leaf overhead; more, some leavies is possibly empty...

Nov 12 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Jamie Pittman via AccessMonster.com | last post: by
8 posts views Thread by w2ajax | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
reply views Thread by Purva khokhar | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.