Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Checking index
Message
From
26/06/2003 14:05:57
 
 
To
16/04/2003 10:11:46
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Miscellaneous
Thread ID:
00778188
Message ID:
00804347
Views:
25
>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:
* Scan through every table
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])

		* Now scan through every index
		lnI = ATagInfo(laI)
		For ny = 1 to lnI

			Wait window "Table: " + Alias() + " Index: " + laI[ny, 1] nowait
			Set Order To (ny)
			Go top
			Scan 
				*** nuttin
				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?
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform