mdtendulkar
Active User
Joined: 29 Jul 2003 Posts: 237 Location: USA
|
|
|
|
Hello krbabu,
For Alternate Indexes,
The RECORDSIZE refers not to the size of the base cluster record, but is computed based upon the size of the keys in both the base cluster and the alternate index and whether the keys are unique not nonunique.
If the keys are unique, the records in the alternate index are fixed length, and the length is the value computed as 5 bytes of control information the length of the alternate key the length of the primary key (for KSDS) or the length of an RBA (for ESDS), which is 4 bytes As for a fixed length KSDS, this length is specified for both the average and maximum value in the RECORDSIZE parameter.
If the keys are nonunique, the records in the alternate index will be variable in length
The average length is computed as:
Quote: |
1) 5 bytes of control information
2) The length of the alternate key
3) The length of the primary key (for KSDS) or the length of an RBA (for ESDS), which is 4 bytes multiplied by the expected average number of nonunique keys
|
The maximum length is computed as:
Quote: |
1) 5 bytes of control information
2) The length of the alternate key
3) The length of the primary key (for KSDS) or the length of an RBA (for ESDS), which is 4 bytes multiplied by the maximum number of nonunique keys.
|
The contents of the 5 bytes of control information stored in the alternate index record indicate the type of the base cluster the alternate index points to and the length of the keys:
Quote: |
The first byte indicates the type of base cluster - x'01' indicates KSDS; x'00' indicates ESDS
The second byte indicates the length of the base cluster pointers in the alternate index record - x'primary key length' if the base cluster is KSDS or x'04' if the base cluster is ESDS
The third and fourth bytes are a halfword value indicating the number of occurrences of the base cluster pointers within the alternate index record; e.g. will contain x'0001' for a unique alternate key
The fifth byte indicates the length of the alternate key
|
Hope this helps,
Regards
Mayuresh Tendulkar |
|