Performance of the query

  • one of my stored proc is taking long time to run.

    ihave used IN in my query which i replace with join ,

    and i am also using union all.

    what should i do to improve performance of this stored proc

  • coool_sweet (3/24/2015)


    one of my stored proc is taking long time to run.

    ihave used IN in my query which i replace with join ,

    and i am also using union all.

    what should i do to improve performance of this stored proc

    Hi, welcome to SSC.

    The best thing I can offer to you is to get you to have a read through this article --> http://qa.sqlservercentral.com/articles/SQLServerCentral/66909/%5B/url%5D.

    It explains how best to ask a performance related problem in the best way to allow the unpaid volunteers from this website to help you.

    At the moment, you've done the equivalent of going to a mechanic without your car and saying "My vehicle isn't working in the way I expect". The mechanic doesn't know anything about your vehicle, can't see it without you bringing it in and your explanation is lacking in details for him to help you.

    Thanks.


    Forever trying to learn
    My blog - http://www.cadavre.co.uk/
    For better, quicker answers on T-SQL questions, click on the following...http://www.sqlservercentral.com/articles/Best+Practices/61537/
    For better, quicker answers on SQL Server performance related questions, click on the following...http://www.sqlservercentral.com/articles/SQLServerCentral/66909/

  • Everything Cadavre said.

    Tuning queries requires understanding what the T-SQL statement you have is doing and understanding how the optimizer works with your T-SQL. The way to do that is to look at the execution plan to understand how youre query is being resolved.

    Without the query, the execution plan or the structures, we can only make vague suggestions. Make sure you're filtering data on columns that have indexes. Make sure you're not using functions on your columns in WHERE, ON or HAVING clauses in the statement. Only retrieve the data you need.

    ----------------------------------------------------The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood... Theodore RooseveltThe Scary DBAAuthor of: SQL Server 2017 Query Performance Tuning, 5th Edition and SQL Server Execution Plans, 3rd EditionProduct Evangelist for Red Gate Software

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

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