Consultor Eletrônico



Kbase P54846: How to calculate the index size?
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   18/11/2003
Status: Unverified

GOAL:

How to calculate the index size?

FIX:

You can estimate the approximate maximum amount of disk space occupied
by an index by using this formula:
Number of rows * (6 + number of columns in index + index column storage) * 2
For example, if you have an index on a character column with an average of 21 characters for column index storage (see Table 4-2) and there are 500 rows in the table, the index size is:

500 * (6 + 1 + 21) * 2 = 29,000 bytes

The size of an index is dependent on four things:
· The number of entries or rows
· The number of columns in the key
· The size of the column values, i.e. the character value "abcdefghi" takes more space than "xyz"
· The number of similar key values

However, you will never reach this maximum because Progress uses a data compression algorithm to reduce the amount of disk space an index uses.
In fact, an index uses on average about 20% to 60% less disk space than the maximum amount you calculated using the previously described formula.
The amount of data compressed depends on the data itself. Progress compresses identical leading data as well as collapses trailing entries into one entry. Typically non-unique indexes get better compression than unique indexes.

NOTE: All key values are compressed in the index, eliminating as many redundant bytes as possible.