Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: How to calculate the size of an index?

Re: How to calculate the size of an index?

From: Steve Howard <stephen.howard_at_us.pwcglobal.com>
Date: 12 Jan 2004 12:57:04 -0800
Message-ID: <6d8b7216.0401121257.41494725@posting.google.com>


Rene Nyffenegger <rene.nyffenegger_at_gmx.ch> wrote in message news:<btudr2$bd78h$1_at_ID-82536.news.uni-berlin.de>...
> > To calculate the size of a table, I usually use num_rows *
> > avg_row_len. But how to I calculate the size of an index? Do I use
> > avg_data_blocks_per_key * distinct_key * db_block_size of the
> > database?
> >
> > Please advice. Thank you.
>
>
> Imho, avg_row_len * num_rows gives you quite a meaningless figure if you
> want to know the size of a table; if this isn't the case for you, please
> elaborate further why this figure is interesting.
>
> Equally imho, better would be to calculate the size for a table like
>
> select bytes from user|all_segments where segment_name = 'TABLE_NAME'
> [and owner = 'OWNER']
>
> The same query can then also be used to find the size for an index.
>
> hth
> Rene

That is the physically used size of the segment, but not the size of the _business_ data it contains, to which I think the OP may be referring. It may be rebuilt much smaller if the INITIAL_EXTENT of the table/index is ridiculously large.

Regards,

Steve Received on Mon Jan 12 2004 - 14:57:04 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US