Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Help Optimizing a query
Message
From
14/08/2001 18:58:29
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
 
To
14/08/2001 17:39:55
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00542086
Message ID:
00543806
Views:
18
>I agree that the setting of DELETED can make a huge difference. BUT... in this case you said you had a single TAG and it was *NOT* on DELETED().
>Yet you got a 3 second improvement running with DELETED OFF vs ON.
>It is that that I find puzzling. I don't see why there should have been any difference at all!

Jim,

If SET DELETED ON, VFP will add, to any condition the programmer specifies, the implicit condition "... AND NOT DELETED()".

I assume that in this case, since there is no index on DELETED(), VFP first gets the 20,000 index keys, and then gets the records themselves (this applies in both cases, DELETED ON or OFF), and then, if SET DELETED ON, VFP has to go through the entire group of records once more, to see if any records don't satisfy the condition.

Warning, for anyone reading this message: The situation would be even worse if the index on DELETED() DID exist. In this case, VFP has to get index keys for most of the records, as part of the "Optimization" process.

Hilmar.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform