Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Handling Deleted Records
Message
From
12/03/2000 03:17:22
Walter Meester
HoogkarspelNetherlands
 
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00344598
Message ID:
00344684
Views:
25
Rick,

>You asked about maintaining an index on DELETED(). The conventional wisdom is that you want to do this for performance reasons in any case, although there has been some dispute about this too. Anyway, if you're recycling records, then the general idea is to SET DELETED OFF and LOCATE FOR DELETED(). If a deleted record is FOUND() then RECALL it and replace the field contents with the new data, otherwise INSERT a new record.

The new wisdom is NOT to use the index tag ond deleted as it can slow down operation significantly. See thread #344424 for an extreme example. In this case it might be wise to have an INDEX ON .T. FOR DELETED() TAG DEL so rushmore won't involve the index in optimization and you can do:

SET DELETE OFF
=SEEK(.T.,"Mytable","Del")

to search a deleted record.

About the recycling records: IMO programming the recycling mechanism takes quite a bit work because you'll have to modify your existing code and doesn't work with SQL-views at all. I've submitted a wish for VFP 7 to make it possible to switch on recycling records on a per table basis. All inserting mechanisms should work with this recycling:
- INSERT
- INSERT SQL
- APPEND BLANK
- APPEND FROM
- SQL-Views

Walter,



>
>HTH,
>Rick
>
>>Hi Rick,
>>
>>Thanks for the reply. Unfortunaly I can't search for a thread number as I am not a member of the UT. I guess you can work both sides of the street depending if the app is multi user or not... My current thinking is to make all apps multi user so the need to handle deleted records without opening the table in exclusive...
>>
>>Thanks
>>
>>>You'll find lots of opinions on both sides of this question. IMO it's an individual design decision, and different apps will have different requirements. There was an interesting discussion abou this here on UT not too long ago. Look for thread #269678 (Coding, syntax & commands - "What's with the Pack command").
>>>
>>>>What is the current school of thought on dealing with deleted records?
>>>>Seems to me that recycling would be the best bet due to having to open a table exclusive in order to pack it.
>>>>
>>>>What methods are used to recycle deleted records?
>>>>
>>>>Do you always have an index on DELETED() so you can SEEK a record then do a REPLACE instead of a INSERT INTO?
Previous
Reply
Map
View

Click here to load this message in the networking platform