Dear D. J. W. van Kooten:
On Sunday, May 6, 2012 2:00:44 PM UTC-7, D. J. W. van Kooten wrote:
> On Fri, 4 May 2012 09:24:16 -0700 (PDT), dlzc <dl***@
cox.net> wrote:
>
> Hello David,
>
> > You could be even more excited, if instead of
> > blindly adding new records, you search for
> > deleted records first, and re-used those that
> > did not still have locks on them. Then packing
> > becomes unnecessary.
>
> That's also an option of ADS, when using their
> native format. I do not like this option however.
> Having the records in natural order equal to the
> order of addition, and being able to access
> deleted records for a while (until they are
> really packed) can help a lot in solving problems.
You can achieve the same effect, by issuing a serial number to each record as it is added, and reuse records with the smallest / oldest serial number first.
> When using such a feature, you would need to
> do a lot of extra work before having the same
> 'check options'. And the advantage may be little;
> some databases may even see more deletions than
> additions when you introduce the feature and are
> still left with deleted records which may need
> packing at some point.
Agreed. The OP however is describing a problem, wherein packing becomes necessary. So this probably will not affect his case.
Additionally, is there a guarantee that when packed, the remaining undeleted records are in the order they were added? I can imagine rolling records down from the end of the file to fill in spaces for deleted records, as a means to speed the operation up.
David A. Smith