Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Do I need to PACK everytime after I deleted a record?
Message
From
13/02/1999 11:53:52
Dave Nantais
Light speed database solutions
Ontario, Canada
 
 
To
13/02/1999 11:25:25
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00187376
Message ID:
00187381
Views:
23
>I'm using FPD. After I delete a record, do I really need to PACK the database and then REINDEX it, so that my index file will be working again? I have problems when dealing with index file with UNIQUE option. The index file wont' be updated when there're changes in my record, such as adding and deleting. If I really need to REINDEX every time, won't it take very long time if I have 1 million records?

use SET DELETED ON

the deleted record will be marked for deletion
it will physically still be in the table , however , users will not see the record in the table and you will not have to REINDEX.

the problems with INDEXing arise when you use PACK.
make sure the INDEX file is open when you make any changes to the .DBF
FPD will automatically update the opened INDEX file.

the RECALL command can bring back a record marked as deleted.

once a week or once a month you should PACK the database and REINDEX it.
I would not even use the REINDEX command because it makes CDX files grow and grow becase it just adds all new indexing info onto the end of the file.

I would PACK and then delete the index file and rebuild it from scratch ...
say once a week or once a month or some appropriate regular time.

HTH, Dave.
Previous
Reply
Map
View

Click here to load this message in the networking platform