left hash JOIN - Could it ever give wrong results?

  • Let me tell you, i do know using hints should be the last option. I am really in a situation where i need to address a issue by hook or crook ( actually most of my issues are addressed like this :hehe:). I have a left join which is executing for each record, i looked in the exec plan and it is using a Nested loop. My goal was to have it execute ONLY once, so i replaced with left hash JOIN and this made it execute only once and made query much much faster. My question is would this type left hash JOIN ever NOT GIVE the same result as LEFT Join.

  • sqldba_newbie (3/22/2013)


    Let me tell you, i do know using hints should be the last option. I am really in a situation where i need to address a issue by hook or crook ( actually most of my issues are addressed like this :hehe:). I have a left join which is executing for each record, i looked in the exec plan and it is using a Nested loop. My goal was to have it execute ONLY once, so i replaced with left hash JOIN and this made it execute only once and made query much much faster. My question is would this type left hash JOIN ever NOT GIVE the same result as LEFT Join.

    Only if there is a bug in SQL Server, because query hints should not affect the results at all.

    And also consider this:

    http://msdn.microsoft.com/en-us/library/ms181714.aspx


    If one or more query hints cause the query optimizer not to generate a valid plan, error 8622 is raised.


    Alex Suprun

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

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