Tuning SP (Left Outer Join)

  • Hi,

    I am working on tuning of sp. They wrote several left outer join. Is there any option to avoid them. Any suggestions please

  • Without any clue on what the desired output is, how the query looks like et cetera, this question is impossible to answer.

    You might get rid of your LEFT OUTER JOINS, if an INNER JOIN suffices.

    However, LEFT OUTER JOINS are not necessarily bad.

    ps: your question looks like this: "Hi, I need to travel to London, can you give me directions?" But we have no idea where you currently are. Are you near London or even in the United Kingdom at all?

    Need an answer? No, you need a question
    My blog at https://sqlkover.com.
    MCSE Business Intelligence - Microsoft Data Platform MVP

  • ramana3327 (3/21/2014)


    Hi,

    I am working on tuning of sp. They wrote several left outer join. Is there any option to avoid them. Any suggestions please

    Left joins are a logic decision, too frequently a defensive decision. Can you tell which type of left join these are? If you can't, then hire a specialist.

    “Write the query the simplest way. If through testing it becomes clear that the performance is inadequate, consider alternative query forms.” - Gail Shaw

    For fast, accurate and documented assistance in answering your questions, please read this article.
    Understanding and using APPLY, (I) and (II) Paul White
    Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden

  • If, logically, you need all the rows from one table, but only the matching rows from another table, then some type of OUTER JOIN is necessary. They're not inherently evil.

    "The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
    - Theodore Roosevelt

    Author of:
    SQL Server Execution Plans
    SQL Server Query Performance Tuning

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

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