I was under assumption that the root segments keys will be in the ascending order. When I checked my workshop database root segments, I wondered they are not in the sequence. For example if have TYRE-NO is defined as key in the root segment of length 5 bytes. The order I am seeing (for each GN calls) '55555', '44444', '11111', '33333'.
Joined: 22 Apr 2006 Posts: 6258 Location: Mumbai, India
Possibly your Data-base is HDAM. Form manuals, in a hierarchic direct access method (HDAM) database, the root segments of records are randomized to a storage location by an algorithm that converts a root's key into a storage location. No index or sequential ordering of records or segments is involved.
The randomizing module reads the root's key and, through an arithmetic technique, determines the storage address of the root segment. The storage location to which the roots are randomized are called anchor points or root anchor points (RAPs).
If you want to know WHY they do this, it's all about physical disk access.
If your key is something that goes up when new data is added, ie first case is 1, second case is 2, then all of your new data would be lumped together on the disk.
Since most of the work being done is on the newest set of cases, then all of the disk access would be trying to get to the same areas of the hard drives. There are only so many concurrent read/writes allowed by any system of access, so this would create a huge bottleneck on a busy system.
Therefore, they spread around the data so that concurrent accesses are reading/writing widely separated areas of the disk(s).