Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Indexing
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Divers
Thread ID:
00647875
Message ID:
00648378
Vues:
22
Hi Doug !
One question. Because VFP database is file system database it seems possible to recreate index file just in such steps:
a) deleting corupted index file
b) copying index file from pattern database (empty database that can be stored for example in application file) to directory with live database
c) reindexing ( through REINDEX command)
It seems also that in similar way we can treat tables. Is something wrong in such method - using pattern database (not code) as a source of proper database structure ?
Thanks in advance.

>Hi Mike.
>
>>Does SDT delete all tags, PACK and then recreate the tags when a PACK is requested?
>
>Ed's answer pretty much nails it. The first thing SDT does is delete the CDX file and blow away all the index and relation records for the table in the DBC (if it isn't a free table). The reason for deleting the CDX is that I've encountered a situation several times where the CDX was so badly corrupted that VFP GPFs on a simple USE command. The reason for removing the index and relation records from the DBC is that if the CDX doesn't exist but those records are still there, VFP won't let you open the table if you have (had) a primary key for the table.
>
>Then, if you request a PACK, we actually do a SQL SELECT to another table in primary key order (if there is one) so the table is physically ordered by the most likely way you'll access the table for performance reasons.
>
>Indexes are then created from the meta data definitions. Finally, there's a big cleanup step where we have to put everything back where it belongs (eg. recreate the relation records, rename the copy table back to the original name, etc.).
>
>It took me roughly 80 hours to write that code, given all the complexity of rebuilding indexes while avoiding all the potential pitfalls.
>
>Doug
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform