Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Another Subquery Problem
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00053707
Message ID:
00054047
Views:
46
>>Using EXISTS:
>>1st Query = avg 225.67 seconds
>>2nd Query = avg 297.89 seconds
>>
>>Using IN:
>>1st Query = avg 266.40 seconds
>>2nd Query = avg 326.15 seconds

>Roxanne,
>
>Those *are* interesting results.
>
>Since I don't recollect much being written in the docs on this topic, the "2 Fox GODS" may be going on prior ovservation/experience. Goes to show that there are lots of variables and that conclusions based on such (*IF* that's indeed the case) are risky at best and SHOULD ALWAYS BE SO QUALIFIED.
>
>Personally I would have *GUESSED* that EXISTS would be faster because the SQL engine *COULD* have been written (here I go again) in such a way that as soon as one record fits, the inner query can stop.
>
>Cheers,
>Jim N
>

Thats the same conclusion I kind of came to... If EXISTS is faster by a measurable amount in this example it must be because the subquery isnt working as hard or running as long as it does with the IN syntax that doesn't have the conditions use to match main query to subquery. Thanks to you too :)
Roxanne M. Seibert
Independent Consultant, VFP MCP

Code Monkey Like Fritos
Previous
Reply
Map
View

Click here to load this message in the networking platform