Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
PACK/REINDEX etc. in VFP
Message
From
19/10/1998 11:32:59
 
 
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00146465
Message ID:
00148135
Views:
29
Hi Bob.

>Sure ZAP will clobber any child tables, since they'll no longer have a parent to link too, but what about REINDEX/INDEX/PACK?

REINDEX:

- Reads the CDX header for the information needed to recreate the indexes (tag name, index expression, FOR expression, etc.). However, when an index is corrupted (the main reason to use REINDEX), the headers are frequently corrupted so you're using corrupted information to recreate the indexes. Very bad!

- Doesn't delete the existing tags in the CDX file, but creates new tags and marks the old ones as no longer used. This is similar to what happens with the contents in a memo file, and the result is the same: a bloated file with much of it outdated information. I've seen CDX files that were 10x the size of the table they indexed!

- DELETE TAG ALL resolves the problem with bloated CDX files but has the unfortunate side effect of deleting the persistent relationships for the table being reindexed.

INDEX

- Nothing inherently wrong with this command, since its the main command used to programmatically create indexes (ALTER TABLE can create indexes too, but only the primary key and those involved in persistent relationships).

- One potential snag: I've seen corrupted CDX files that were in such bad shape that merely opening the table (ie the USE command) caused FoxPro to GPF! Be sure to delete the CDX file first!

PACK

- Frankly, I think the problems people associate with this command are an urban myth <g>. The usual complaint is that if the system crashes in the middle of a PACK, all the data is lost. Not true: FoxPro backs up the table to a BAK file prior to packing (although you *do* have to rename this file once the system is back up again).

As an aside, Stonefield has a product called Stonefield Database Toolkit (SDT) that overcomes the problems I've outlined regarding recreating indexes (and many others as well, such as repairing corrupted table and memo headers and updating table structures at remote sites). Stonefield offers discounts to UT members; see the Partnership section for details.

Doug
Previous
Reply
Map
View

Click here to load this message in the networking platform