which one of inner join or left join is efficient and in what way.kalaivanan wrote:
Quote:
Originally Posted by
hi dis is kalaivanan,
which one of inner join or left join is efficient and in what way.
Inner joins and outer joins achieve different results so in general it
won't make sense to compare them on performance.
In cases where an inner and outer join are guaranteed to give the same
result I suggest you test it out for yourself. Performance is too
heavily dependent on other factors for there to a be a single, simple
answer.
--
David Portas, SQL Server MVP
Whenever possible please post enough code to reproduce your problem.
Including CREATE TABLE and INSERT statements usually helps.
State what version of SQL Server you are using and specify the content
of any error messages.
SQL Server Books Online:
http://msdn2.microsoft.com/library/...US,SQL.90).aspx
--|||David Portas (REMOVE_BEFORE_REPLYING_dportas@.acm.org) writes:
Quote:
Originally Posted by
In cases where an inner and outer join are guaranteed to give the same
result I suggest you test it out for yourself.
And in that case, I expect the optimizer to see that the left join is
really an inner join, and thus you would get the same query plan.
The question is simply not meaningful, since, as David pointed, the
difference lies in functionality.
--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pr...oads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodin...ions/books.mspx
No comments:
Post a Comment