Fast method to fetch data

Hi All,

Can anyone please explain me which is FAST ‘Read by ISN’ or ‘Read Physical’ and why ?


ISNs are associated with a record. Indeed, in Adabas, every record has its ISN as a part of the record.

ISNs are logical rather than physical identifiers.

Suppose I start off by loading a file with 100 records. We let Adabas assign ISNs, hence we have ISNs 1-100. Assume the records are initially all the same size, and we have 10 records in each of ten physical blocks.

Next we update ISN 4. The nature of the update triples the length of the record.

Realize what a mess (and how inefficient) it would be if Adabas tried to keep the file in ISN sequence.

Instead, it moves the record (ISN 4) to block 11. HOWEVER, the ISN, which is logical, not physical remains 4.

Over time, especially if the file is defined with “reusable ISN”, the file is nowhere close to being in ISN sequence.

If you read a file in physical sequence, there is a good likelihood that you will do only one physical i/o per block.

HOWEVER, if the file is not in ISN sequence, you could conceivably (okay , this will almost never happen) end up doing a physical i/o for every record.

Imagine we have a file with last names and first names, both of which are descriptors.

We presort the file prior to its creation, into last name sequence. If we do a READ LOGICAL by last name, we should see one physical i/o per block. However, if we read the file by READ LOGICAL of first name, we will almost certainly “bounce around” a lot, leading to far mor i/os per record.

In general:

READ PHYSICAL is the fastest way to read a file.

READ by ISN is next fastest


However, if a file has just been loaded after being sorted by some descriptor, and Adabas is assigning ISNs, and there are few values of the descriptor, the difference between the three might be very small.

After a lot of updating, without intervening sorts and reloads, but with changes made to the descriptor used for the sort, but retained ISNs, it is likely the above will prevail.

Thanks very much Steve, explaining with example.