Calculating the Length of Index Items

For data types other than VARCHAR, the length of an index item is calculated by adding the length of the key value plus the size of each rowid associated with the key value, plus 1. The size of a rowid will be 4 for SMALL tables and 8 for LARGE tables.

The key values in an index are typically of fixed length. If an index holds the value of one or more columns of the VARCHAR data type, the length of the key value is at least the sum of the length-plus-one of each VARCHAR value in the key.

In Informix® 15.0.0.0, the maximum length of a key value is 32,767 bytes, which is the maximum size of a data row. To achieve this maximum, the index must be built in a dbspace with a 256k page size. The smaller the index page size, the smaller the index key size that can be supported. For example, the largest key size that will fit on a 2k page is 380 bytes.