Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Which of the following is better Optimized
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00307908
Message ID:
00307914
Views:
13
>Hi Everyone,
>
>Is query #1 as optimized as query #2:
>
>QUERY #1
>SELECT one,two FROM table1,table2 where table1.id = table2.id
>
>QUERY #2
>SELECT one,two FROM table1 INNER JOIN table2 ON table2.id = table1.id
>
>Or are they both equally as fast? I'm using VFP 5.0.
>
>I'm not concerned about which one is *SQL* correct... just speed.
>
>THANKS!

Shawn,

The optimization is controlled by the indexes that exist in both of them. They should be nearly equal in time required although at any one run one of them may out perform the other depending on the machine status at the time of the run. IOW, they are equivalent in terms of the results gotten adn the time it will take to get those results.

That said, I would suggest the more "correct" one using the JOIN syntax and leave the WHERE clause for filtering the result set.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform