A question regarding Index Sizes (Curiosity mainly!!).
Posted in 1999
Topics: Server Administration, Security, Permissions & Auditing, Migration, Import/Export & Data Conversion
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.