joins

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • kalaivanan

    joins

    hi dis is kalaivanan,
    which one of inner join or left join is efficient and in what way.

  • David Portas

    #2
    Re: joins

    kalaivanan wrote:
    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:

    --

    Comment

    • Erland Sommarskog

      #3
      Re: joins

      David Portas (REMOVE_BEFORE_ REPLYING_dporta s@acm.org) writes:
      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@sommarsk og.se

      Books Online for SQL Server 2005 at

      Books Online for SQL Server 2000 at

      Comment

      Working...