471,896 Members | 2,080 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,896 software developers and data experts.

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 2387
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
reply views Thread by YellowAndGreen | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.