If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > How to get the estimated size of an index

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 11-21-11, 18:54
db2user24 db2user24 is offline
Registered User
 
Join Date: Nov 2007
Posts: 248
How to get the estimated size of an index

Hi, I'm aware that one can get the size of a table after giving the RUNSTATS command and then giving a command like this --

db2 "select substr(t.tabschema,1,10)||'.'||substr(t.tabname,1, 20) as table ,char(date(t.stats_time)) as statsdate ,char(time(t.stats_time)) as statstime ,T.CARD as rows_per_tbl, decimal(float(t.npages)/(1024/(ts.pagesize/1024)),9,2) as used_mb ,decimal(float(t.fpages)/(1024/(ts.pagesize/1024)),9,2) as allocated_mb from SYSCAT.TABLES T ,SYSCAT.TABLESPACES TS where t.tbspace=ts.tbspace and T.tabname='EMPLOYEE' and T.TYPE='T'"

TABLE STATSDATE STATSTIME ROWS_PER_TBL USED_MB ALLOCATED_MB
------------------------------- ---------- --------- -------------------- ----------- ------------
DB2USER .EMPLOYEE 11/21/2011 17:45:08 811088680 38428.18 38428.18



Similarly, is there a command I can give after giving RUNSTATS on the index of a table that will give me the estimate of the index size? thanks!!
Reply With Quote
  #2 (permalink)  
Old 11-22-11, 02:05
przytula_guy przytula_guy is offline
Registered User
 
Join Date: Apr 2006
Location: Belgium
Posts: 1,159
there is a column that indicates the nbr of leaf pages..
and also info about intermediate levels..
maybe this will help
Space requirements for indexes - IBM DB2 9.7 for Linux, UNIX, and Windows
__________________
Best Regards, Guy Przytula
Database Software Consultant
DB2 UDB LUW Certified V7-V8-V9-V9.7 DB Admin - Dprop..
Information Server Datastage Certified
http://www.infocura.be
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On