Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
REINDEX or CREATE INDEX??
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00522798
Message ID:
00522817
Views:
11
>>>what is the best way to reorganize the indexes of a certain table: the REINDEX command or droping all indexes and recreating them?
>>>
>>>I´m asking this because I want to create a generic class that reindexes all the tables (from all databases) in one application. If you have some suggestions about this, please, let me know! ok??
>>>
>>>TIA
>>>
>>>Alonso
>>
>>REINDEX relies on the key information stored in the header of the CDX. If that >is corrupt, it will not properly rebuild the index. Also, REINDEX causes CDX >file bloat. The best way is to DELETE TAG ALL then INDEX. Be careful though. >If you are using any persistant relations, deleting the index tag will also >delete the relation. I highly recommend using a tool like Stonefield data >tools that keeps track of all the keys and relations and rebuilds them.
>
>I agree with all of you guys. My idea was to have a table with the database that the table belongs, the table name and the index information (name, fields, etc.), so I can use macro substituion to recreate them.
>
>In the case of the persistant relations, can I delete the indexes, recreate them and then recreate the relations? Or maybe, delete the indexes in such order so the persistant relations would be kept? Buying Stonefield data tools is completely out of question now.
>
>Thanks!
>
>Alonso

Hi Alonso,

Just a thought... it might be worthwhile checking what REINDEX actually does TODAY if you are running VFP6 with SP3 or later.

Since SP3 REINDEX reportedly was made much faster by doing its job in a single pass. That being the case they (VFP team) might also have taken the opportunity to eliminate the bloat (formerly???) associated with the command. After all, doing it in a single pass means they no longer need to leave the old info intact so that they can read it to process the next TAG.

I don't have tables with indexes big enough to check this out here.

good luck,

JimN
Previous
Reply
Map
View

Click here to load this message in the networking platform