Previous Topic: Storage of Values

Next Topic: Other Considerations

Suggested Key Ranges

The following are suggested key range breakups:

X'0000' to X'002F'

Includes the control, transaction, and field records. The transaction records have the most activity. The field records can be in the same key range, as they are only referenced on NDB START, or when an &NDBDEF statement is processed.

X'0030' to X'003F'

Includes all the key records, and, for databases with a sequence key, the RID to sequence key relation records.

Splitting the key records by field is not feasible because the field code is not readily determined. If fields have been added or deleted, the code can change if an NDB is unloaded and reloaded. The only field code that is guaranteed is the field code for a sequence key, which is always X'0001'.

If field codes are necessary for splitting key records, the field information records (record type X'0020') contain the field code in bytes 3 through 4 of the key. The code is also in the data, in the 2 bytes immediately following the key. The next 12 bytes after the field code in the data contain the field name. Remember that this field code can be different if an NDB is unloaded and reloaded.

X'0040' to X'FFFF'

Contains all data records.

For NDBs with a sequence key, the data can be broken on sequence key value by preceding the value limits with X'00400001'. For example, if an NDB has a character sequence key, and you want to break A-K, and L-Z, you can use:

X'00400001C1' to X'00400001D2' (A-K)
X'00400001D3' to X'00400001E9' (L-Z)