Data type | Char.set | Width / Precision | Indexed data size | |
---|---|---|---|---|
- | ||||
- | ||||
- | ||||
- | ||||
- | ||||
- |
Number of columns | 1 |
---|---|
Total key size | 8 |
Remains | 248 |
Note: non-binary collations on single-byte character sets are always 3 level in Firebird 1.5, but can be 1 or 2 or 3 level in Firebird 2, so pay attention to choose the proper one.
Have you ever been surprised by error messages like these when creating indexes ?
unsuccessful metadata update -key size too big for index IX unsuccessful metadata update -key size exceeds implementation restriction for index "IX"You do not know why you can index the first column, but not the second one ?
A VARCHAR(100) CHARACTER SET ISO8859_1; B VARCHAR(100) CHARACTER SET ISO8859_1 COLLATE EN_UK;This little "Firebird Index Key Size Calculator" TM lets you play with different data types, looking at resulting size of internally used index key. Maximum index key size is 252 bytes (for Firebird <= 1.5) or 1/4 of page size (Firebird 2). The computation (especially for multi-column keys) is a bit complicated, so don't be surprised by unexpected results. (Non-binary collations triple the size of single byte character sets. Integers are converted to double precision. etc.) Maximum number of segments is 16.