[Info-vax] Indexed file read question

Dave Froble davef at tsoft-inc.com
Wed Nov 18 12:51:59 EST 2020


On 11/18/2020 12:24 PM, Stephen Hoffman wrote:
> On 2020-11-18 16:35:41 +0000, abrsvc said:
>
>> On Wednesday, 18 November 2020 at 11:20:54 UTC-5, Stephen Hoffman wrote:
>>> On 2020-11-18 15:23:13 +0000, abrsvc said:
>>>
>>>> Situation: Indexed file with 2 keys, the first key no duplicates,
>>>> second key no duplicates. For clarity, the first key is a record
>>>> number and the second key is one of 4 values: A,B,L or blank.
>>> With only four records possible, why is this even a file? Which
>>> implies there *are* duplicates on the secondary?
>>
>> I have over simplified the situation just to provide a context for the
>> question.  This is just one of many questionable practices wihtin this
>> code system.
>> More time is spent opening and closing files with singular records
>> than anything else.  I am not in a position to change this, I am just
>> trying to assist with understanding how the current system works.
>>
>> Update:  There are duplicates for the second key.
>
> I've long assumed the order of record retrieval is indeterminate when
> switching to a secondary key with duplicates; that's what is documented.
>
> That secondary key would usually be created as a segmented key here, if
> the primary is to (also) be involved in the ordering of secondary record
> retrieval.
>
>

Ok, some RMS trivia.

The primary key is an ISAM structure.  If I remember correctly, the data 
records are sequenced (poor term) by the primary key order in the tree 
structure.  Basically the primary key and the data record are the same 
piece of data.  (Makes insertions interesting.)

However, all secondary key structures do not follow the scheme of one 
key for each record.  Instead, for each unique secondary key, there is 
one key "record", in the ISAM tree structure, with a list of the records 
with that value for the secondary key.  Not sure how new entries are 
added, most likely in the front of the list, or the end of the list, I'd 
guess the end.  I'd assume a linked list.

Not the way I'd design it.  But I wasn't asked.  My database product has 
one key record in each key structure for each data record.  Just the way 
I approached the implementation.

-- 
David Froble                       Tel: 724-529-0450
Dave Froble Enterprises, Inc.      E-Mail: davef at tsoft-inc.com
DFE Ultralights, Inc.
170 Grimplin Road
Vanderbilt, PA  15486



More information about the Info-vax mailing list