Which one is faster [message #22805] |
Tue, 29 October 2002 21:32 |
Pujar
Messages: 1 Registered: October 2002
|
Junior Member |
|
|
Hi! All,
I have a Confusion with Subquery and join.
My question is which one is fast?
Please tell me how to test timing's
Thank U
Pujar
|
|
|
|
Re: Which one is faster [message #22867 is a reply to message #22805] |
Sat, 02 November 2002 17:58 |
Su
Messages: 154 Registered: April 2002
|
Senior Member |
|
|
As Todd said, it depends. But a normal/plan subquery is faster than corelated subquery. Unless it is needed to do so or no alternative, giving a co-related subquery is not a good idea (performancewise) as each and every time the main query fetches a row the corelated subquery is processed to check its output against the fetched row of main query, causing slow down in the entire query's performance, whereas a plain subquery is processed only once to retrieve its output to check with the rows fetched by main query.
And rest depends on the use of keys and indexes on them. Hope you understand my point.
Good luck :)
|
|
|