The key information record describes the physical characteristics of all the keys used in the file, including the length of each key; where the key is defined within the data record; whether duplicates are permitted, and so on. Within the key information record structure is a sub-structure, the key block. A key block is created for each key defined. The first key block always describes the primary key. Subsequent key blocks define the alternate keys in the order specified when the file was created. If the key information record is not big enough to hold key blocks for all the keys defined, equal sized continuation records are created, each pointing to the next, until all the keys have been defined.
The key information record contains:
Size | Description of the field |
---|---|
2 | Record header. Present only if index nodes have record header. See the topic the topic Types of Indexed File for details. |
2 |
|
file-pointer-size | Address of continuation record. Zero if no further continuation records. |
n | Key block for primary key |
... | ...one for each alternate key in the file |
n | Key block |
1 | Reserved. Value x"FF". |
1 | Reserved. Value x"7E". |
For all indexed file formats except IDXFORMAT"8" or IDXFORMAT"12", the key block contains:
Size | Description of the field |
---|---|
2 | Length of this entry in bytes. |
4 | Address of the root index node record for this key. |
1 | Key compression:
|
5 | Key component block |
... | ...if the key is split, one block per component |
5 | Key component block |
For IDXFORMAT"8" and IDXFORMAT"12" files, the key block contains:
Size | Description of the field |
---|---|
2 | Length of this entry in bytes. |
1 | Sparse key character. |
13 | Reserved. |
1 | Key compression:
|
1 | Key flags:
|
6 | Key component block |
... | ...if the key is split, one block per component |
6 | Key component block |
For all indexed file formats except IDXFORMAT"8" or IDXFORMAT"12", the key component block contains:
Size | Description of the field |
---|---|
2 |
|
2 | Offset of component within data record, starting at 0. |
1 | Component type. Value zeros. |
For IDXFORMAT"8" and IDXFORMAT"12" files, the key component block contains:
Size | Description of the field |
---|---|
2 | Length of component in bytes. |
2 | Offset of component within data record, starting at 0. |
1 | Component flags:
|
1 | Component type:
|