• Eugene Elutin (1/28/2013)


    purushottam2 (1/28/2013)


    Yes, Because in one of my query, i am joining with 3 tables. And table 1 have the 1 million record, 2 Lakh and table3 have 10 thousands.

    I am using inner join, so question came on my mind how order of join works. For the above case it is important to know.

    SQL query optimizer should (and most of the times it does) figure out the best sequence by itself.

    Saying that, I used to follow my old custom to drive query from the smallest table/data set...

    I believe the SQL Optimizer can change the join order for queries that use only inner joins. Once you start introducing Outer Joins the order of the joins matters and a different order of Outer Joins could produce a different result set.

    (Now, im currently looking for the source i read this from but having difficulty finding it again. If i find it ill edit this post with a link to the source.)


    For faster help in answering any problems Please read How to post data/code on a forum to get the best help - Jeff Moden[/url] for the best way to ask your question.

    For performance Issues see how we like them posted here: How to Post Performance Problems - Gail Shaw[/url]

    Need to Split some strings? Jeff Moden's DelimitedSplit8K[/url]
    Jeff Moden's Cross tab and Pivots Part 1[/url]
    Jeff Moden's Cross tab and Pivots Part 2[/url]