>When I asked Doug Hennig if SDT might someday have an Index checker utility, the reply was that his research showed that it could take as long or longer to check an index as to simply recreate it. Therefore his recommendation is if you are concerned with corruption, recreate the indexes.
While I do not doubt that it is faster to reindex than check to see if indexes are bad, reindexing will only get the system back into working order. On the other hand, if there was a simple way to determine which tables and tags are prone to corruption and what kind of corruption, that data could be analyzed and the system could be fixed so that reindexing is required less often in the first place.
Anybody have any good ideas?
Using SDT's meta data, I could write a utility to verify that all the index tags exist, so thats not a big deal. The question is what if they exist but are corrputed? Here is a simple way to test, but I feel it is only scratching the surface of what we need:
Local laT[1], ;
lnT, ;
laI[1], ;
lnI, ;
nx, ;
ny
Select 0
lnT = ADBObjects(laT, "TABLE")
For nx = 1 to lnT
If not Used(laT[nx])
USE ('ims5!' + laT[nx])
lnI = ATagInfo(laI)
For ny = 1 to lnI
Wait window "Table: " + Alias() + " Index: " + laI[ny, 1] nowait
Set Order To (ny)
Go top
Scan
x=1
EndScan
EndFor
USE
EndIf
EndFor
Run this, and see if an error occurs. The wait window will tell you where.
But are there more complete tests out there?