Can someone explain / point me to any article that explains how SQL Server performs joins

  • Hi All

    I am looking for a very basic information on how is a join performed by sql server internally?

  • Yes... all joins basically fall into 3 categories behind the scenes... Hash, Merge, or Looping. A 10,000 foot overview for each is availbable in Books Online (BOL) and the following BOL Urls... Just open BOL and paste each into the "URL:" field on the screen.

    Hash Joins:

    ms-help://MS.SQLCC.v9/MS.SQLSVR.v9.en/udb9/html/93ddb967-cb57-4b0e-8b3c-c53e3e803970.htm

    Merge Joins:

    ms-help://MS.SQLCC.v9/MS.SQLSVR.v9.en/udb9/html/dc6ea832-f0ad-41a2-87b8-7134cfaa85dc.htm

    Looping Joins: (actually listed as "Nested Loops")

    ms-help://MS.SQLCC.v9/MS.SQLSVR.v9.en/udb9/html/ea9672ad-14c7-4a8f-8a33-4f768a7e5ae1.htm

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • You can also read this post. I don't know if there's more info than in BoL though.

    http://sqlinthewild.co.za/index.php/2007/12/30/execution-plan-operations-joins/

    The links after each section go to the blog of one of the SQL dev team who works on some of this stuff. If you want lots of technical details later on once you understand the basics, that's where to go.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply