Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Indexing
Message
From
23/04/2002 16:53:17
Mike Yearwood
Toronto, Ontario, Canada
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Miscellaneous
Thread ID:
00647875
Message ID:
00648423
Views:
25
If the pattern gets corrupted, you'll need some code to create the pattern again. So why not just use the code. That's one less thing that can go wrong.
>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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform