Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Which SQL will execute faster?
Message
From
01/01/2007 11:01:19
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
General information
Forum:
Visual FoxPro
Category:
Troubleshooting
Miscellaneous
Thread ID:
01181138
Message ID:
01181202
Views:
8
>Let me pose this related item: It seems that one way to have an inner join execute as fast as possible is to minimize the size of the input sets from which the join is derived. For example, using my example below, if there are a lot of matches ON b.somefield=a.somefield, but overall few matches WHERE a.field1="X", it seems to me that it would be most efficient to have the WHERE execute first rather than last, thus minimizing the input overhead on the join operation. Assuming that some things are known about the data (such as in this example where I know that the WHERE logic results in only a few matches), is it more efficient to first dredge a subset from set "a" into a cursor, and then join that cursor with set "b"? This approach would impose the WHERE clause first.

I used that approach successfully in VFP6, but it seems the VFP SQL parser got much smarter meanwhile.

You may just benchmark it and see what's faster.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Previous
Reply
Map
View

Click here to load this message in the networking platform