General information
Category:
Databases,Tables, Views, Indexing and SQL syntax
>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
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only