Rick C. Hodgin
Programmer
We have customers that have bad networking software / settings. We've worked with their IT to try and get them squared away, but some customers just won't address it or can't seem to get it fixed. As such, we run into missing records not in index (but they are in the table) on a regular basis.
I've been coding a live reindex feature that reindexes the table while it's in shared use. It works, but when I was almost finished it occurred to me there's a VFP9 solution.
If your system doesn't use the DELETED() flag / condition on any records, but instead uses something like lDeleted, then you can create your index tags with an added FOR clause, which is FOR NOT DELETED(). This will include every record by default, and give you the live reindex ability.
If a record is ever not in index, which can be detected through a variety of ways, then it can be put back into the index by going to that record with no active index set (SET ORDER TO), and then issuing DELETE, and then issuing RECALL.
It seems to work well on single-records.
On large-scale DELETE and RECALL operations it also works, even in a SHARED manner, but it is slow and produces a CDX that is much larger than the original. In one test with 10M records, the table was 48 MB, the index 49 MB before the DELETE and RECALL. After, the index had grown to 115 MB. So it's not a wide solution for everything, but single point failures it might be doable.
--
Rick C. Hodgin
I've been coding a live reindex feature that reindexes the table while it's in shared use. It works, but when I was almost finished it occurred to me there's a VFP9 solution.
If your system doesn't use the DELETED() flag / condition on any records, but instead uses something like lDeleted, then you can create your index tags with an added FOR clause, which is FOR NOT DELETED(). This will include every record by default, and give you the live reindex ability.
If a record is ever not in index, which can be detected through a variety of ways, then it can be put back into the index by going to that record with no active index set (SET ORDER TO), and then issuing DELETE, and then issuing RECALL.
It seems to work well on single-records.
On large-scale DELETE and RECALL operations it also works, even in a SHARED manner, but it is slow and produces a CDX that is much larger than the original. In one test with 10M records, the table was 48 MB, the index 49 MB before the DELETE and RECALL. After, the index had grown to 115 MB. So it's not a wide solution for everything, but single point failures it might be doable.
--
Rick C. Hodgin