Unless you specified otherwise in the tablespace definition; each page

of a table will occupy 4k of disk space. Multiply the number of pages by

4k and you have the physical space occupied. This space also includes

freespace on the pages.

The number of leaf pages for an index contains a count of all except 1

page for two level indexes. For three level indexes; you can make a

guess by multiplying the number of leaf pages by a number between 1.0

and 1.2. This is a very crude technique.

Sum up the number of pages for all of the indexes, add the space

occupied by the data and you'll have your final answer. LOB obkects,

stored separately from other table data, occupy additional space.

Any technique that uses ...pages counts in the catalog is accurate only

immediately after running runstats. If the statistics are stale, then

the size estimates will be stale.

There are also other ways of determining space.

Philip Sherman

chettiar wrote:

Hi,

I am wanting to find out the size of a table for which I am using the

following query:

select c.card * b.columnlength from syscat.tables c,

(select sum(a.avgcollen) as columnlength from syscat.columns a

where a.tabname = <colname>) b

where c.tabname = <colname>

and c.tabschema = <schemaname>;

My question:

How can I use the Npages in the syscat.tables to arrive to the size of

the table.

How can i estimate the size of the indexes for a table.

How can i find out the size of the allocated space for the table and

index.

Regards

Sandip