[Info-vax] Indexed file read question
abrsvc
dansabrservices at yahoo.com
Wed Nov 18 12:42:32 EST 2020
On Wednesday, 18 November 2020 at 12:24:10 UTC-5, 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.
> --
> Pure Personal Opinion | HoffmanLabs LLC
OK Thanks. That is what I thought. These are not segmented keys. I will look further, but posts here have supplied what I needed.
RE: The overall application design: There are numerous instances of files being used as message communication mechanisms with 1-10 records each. Not very efficient, but that is how this system was created. Many cases of the following sequence: Open file, update 1 field in a record, close file. Very crude synchronization technique as each open is in a loop such that if file is locked, go back and try again (forever...) until you get it open.
Many other such items throughout the code. I am not involved with "fixing' the problem, only to explain how it currently "works".
More information about the Info-vax
mailing list