The Question is:
please could you tell me if accessing records in an RMS indexed file is more
efficient by RFA or by primary key?
Is the access by RFA adversely affected by bucket splits and record deletions
The Answer is :
Yes, RFA access is always more efficient than access by an index key.
Accessing a record by RFA allows RMS to go directly the bucket where
the record was originally created, and look for the correct ID using
a simple binary match, and normally a single cache lookup or I/O is
There are cases where RMS might perform the lookup and might not find
the record itself, where RMS might find a RRV for it; a redirection.
This case arises if the record was ever involved in a bucket split.
RMS will then follow that RRV for an additional cache lookup (and an
I/O, if neeed). There will be no more than one RRV indirection.
Accessing a record by primary key involves at least one index lookup,
and more commonly additional lookups as the index tree is commonly
two or three or more levels deep. From the lowest-level index, RMS
locates the bucket that actually currently holds the record and RMS
will then sequentially scan that bucket looking for a key match,
using the appropriate comparisons and decompression support.
Obviously RFA access is always more efficient, and can be roughly
three times more efficent.
Bucket splits, as referenced above, can cause a redirection should
the have been resident in the upper portion of the split bucket. If
subsequent bucket splits occur, the original RRV is updated to point
to the current residence for the record; there is only one indirection.
As follows from this, bucket splits can be expensive operations owing
to the need to update all existing affected RRVs.
Do realize that RFA-based pointers require maintaining consistency
across the contents of the target file and a separate storage of RFA