If my super descriptor has more than one record for a particular value, is there any logic in how ADABAS builds the inverted list? (the example below seems to suggest that it then goes in ISN sequence)
If multiple records have the same value for a descriptor, then a FIND or a READ LOGICAL by that descriptor, for that value, will return the records in ISN sequence.
A FIND without a SORTED BY will return all results in ISN order, regardless of the value of the descriptors (if, for example, you have used a range, not equals, OR’s that select on more than one value).
Ralph’s comment is applicable to the READ LOGICAL only.
How does this not pertain to FIND? The following would generate Kugh’s report.
FIND file WITH TRTR-ACNT-DATE-SEQ-S = '0104104992009092510'
Even if the selection criterion was wider, additional records (ISNs) might be interleaved, but these three (with the identical value) would be returned in ISN sequence (as you say, presuming there is no SORTED BY clause).
I’m presuming that Kugh’s question had more to do with the way records are returned than the way they are stored.
The reason Adabas maintains all ISN lists in ISN sequence is quite simple. Consider a simple search argument like DEPT=2 AND SCLASS=4.
If the lists were not in sequence (they are), Adabas would have to take each ISN from the smaller list, and compare it against all the ISNs from the longer list; or, do the converse. Either way, a fairly expensive process.
Since the lists are in ISN sequence, Adabas can do the equivalent of a “match-merge” operation, looking for ISNs on both lists. This is far more efficient than either of the afore mentioned procedures.