Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Is Reindex safe?
Message
From
14/01/2019 01:06:07
Al Doman (Online)
M3 Enterprises Inc.
North Vancouver, British Columbia, Canada
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
01665364
Message ID:
01665366
Views:
79
>Hi,
>
>I have not used the REINDEX command in a very long time. And I am getting a lot of problems related to the application not being able to read some .cdx files. These CDX files are part of the SFQUERY and SDT and I don't know the structure of the indexes. So, just to be sure that the problem is not with a corrupted index, I thought I would reindex these DBFs.
>I am thinking of simply executing the following command:
>
>
>use SDTMETA
>REINDEX
>
>
>And the same with a couple of other meta DBFs. Is the above safe?

REINDEX, by itself, does not fix certain types of index file corruption. IMO a better option is to overwrite the problematic CDX(s) with known good ones, either from a backup, your development environment etc even if they are out-of-date, then issue REINDEX to bring it up to date.

Another approach is to DELETE TAG ALL, then manually rebuild all the index tags. I've always been a bit wary of doing that in case it breaks any referential integrity that may have been defined in a VFP database. I find it easier just to overwrite the CDX file(s) as long as you have any sort of known good version.

My suspicion is that all this is dealing with symptoms. Something else is probably causing these file read errors, which is manifesting as problems with your CDX(s). The CDX(s) may or may not actually be bad.
Regards. Al

"Violence is the last refuge of the incompetent." -- Isaac Asimov
"Never let your sense of morals prevent you from doing what is right." -- Isaac Asimov

Neither a despot, nor a doormat, be

Every app wants to be a database app when it grows up
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform