Execution plan differences

  • Wtf Dev????????

    Gonna have to have a little talk with my boss!!!!!!

  • FYI - I just tested (and verified) that this behavior exists in Enterprise SP3a as well as Personal Edition SP3a.

  • Possible answer off the MS TechNet site - The answer makes sense!

    (in response to the exact same question posed here):

    The way the first query is written forces the joins in a specific order.

    This can be functionally useful if you have a combination of inner and outer

    join, and it works more or less the same as using derived tables or

    subqueries.

    However forcing the join order in that way prevents the Query Optimizer from

    considering certain query plans, and in this case prevents it from

    considering a better query plan. (In some rare cases forcing the join order

    can also be used the other way around, to prevent the Query Optimizer from

    considering some less-than-optimal query plans). Writing the query like you

    do in query 2, allows the Query Optimizer to consider more possible query

    plans, one of which turns out to be better than the one used by query 1 and

    3.

    --

    Jacco Schalkwijk

    SQL Server MVP

Viewing 4 posts - 16 through 18 (of 18 total)

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