Re: A question regarding Index Sizes (Curiosity mainly!!).
Posted in 1999
On Tue, 30 Mar 1999 stuartk@au1.ibm.com wrote:
> For some time now, I have been intrigued about the "index size" which is
> reported by the supplied utilities such as dbschema and dbexport.
>
> For example:
>
> { TABLE "dba".table1 row size = 81 number of columns = 3 index size = 12 }
> ^^^^^^^^^^^^^^^
> create table "informix".notes
> (
> integer1 integer,
> smallint1 smallint,
> char1 char(75)
> );
> revoke all on "dba".notes from "public";>
> create index "dba".table1_idx on "dba".notes (integer1);
>
> >From my understanding in the manuals, the to calculate the size of the
> index,
> it is the (length of the fields in the index) + 4, so theoretically I was
> expecting to see 8 as the index size (integer length 4 + 4).
>
> After some fiddling, trying out different indexes etc. and seeing what
> dbschema was reporting in each case, a formula has come to light of how
> the utilities calculate their reported amounts.
>
> This formula is as follows, where k = sum(length of each field in index):
>
> index size = k + int(k/2) + 6
>
> This works with every table in our schema.
>
> Just out of curiosity, I was wondering if anyone can enlighten me as to why
> this formula is used by the utilities, since I cannot relate it back to the
> manuals in any way at all ?
>
> --StuK.
>
>
Stuart,
I asked the same question about a month ago and got only 1 response.
I'm not sure to the accuracy of the answer so I will just include the
message sent to me.
>Hi, Joseph:
>
>I'm not sure if you ever got an answer to your newsgroup question, but the
>size
>of an index entry is :
>
>key size + rowid + delete flag + slot entry
>
>key size -- in your example (integer), this is 4 bytes
>rowid is 4 bytes
>delete flag is 1 byte
>slot entry is 4 bytes
>
>So, in your case, the math would be:
>
>4 + 4 + 1 + 4 = 13
>
>Perhaps (i.e., I don't know for sure) dbschema does not report the 1 byte
>taken up by the delete flag.
>
>HTH
>
>--Jeff
>
>===========================================================
>Jeff Tyzzer
>Senior Consultant
>Data Warehouse Consulting Practice
>Informix Software, Inc.
>Phone: (916) 491-1262
>E-mail: jtyzzer@informix.com
>===========================================================
This might shed some light on the subject or maybe someone else can
help. Because I've never heard of a delete flag in Informix or slot
entry.
Joe
-------------------------------------------------------------------------
Joseph Cullipher <joseph@cannonexpress.com> Standard Disclaimers Apply
-------------------------------------------------------------------------