Query was executing fine and suddenly started taking time

  • Hi all expert,

    I am facing a problem .

    I am having a query on PROD , which used to execute within 2-4 minutes till some days back.

    Now its taking more than an hour, really dont know what is happening . Nothing has happen over a period of time.

    We Checked the execution plan and found that it is using index seek.

    Can't think what can be the cause. Has anyone faced the similar suituation . Any advice is highly appreciated .

    Thanks.

  • Stale statistics?

    Parameter sniffing (or the lack of it)?

    It is nearly impossible to help without some details. Please see this article from Gail about how to post performance issues. http://www.sqlservercentral.com/articles/SQLServerCentral/66909/[/url]

    _______________________________________________________________

    Need help? Help us help you.

    Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.

    Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.

    Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
    Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
    Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
    Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/

  • Sean Lange (1/10/2014)


    Stale statistics?

    Parameter sniffing (or the lack of it)?

    It is nearly impossible to help without some details. Please see this article from Gail about how to post performance issues. http://www.sqlservercentral.com/articles/SQLServerCentral/66909/[/url]

    Parameter sniffing cannot occur in my case because it is simple update query .....

    and we did update statistics but it was also not hepfull 🙁

  • Shadab Shah (1/10/2014)


    Sean Lange (1/10/2014)


    Stale statistics?

    Parameter sniffing (or the lack of it)?

    It is nearly impossible to help without some details. Please see this article from Gail about how to post performance issues. http://www.sqlservercentral.com/articles/SQLServerCentral/66909/[/url]

    Parameter sniffing cannot occur in my case because it is simple update query .....

    and we did update statistics but it was also not hepfull 🙁

    OK so post an actual execution plan at bare minimum. Table definitions including indexes would also help.

    _______________________________________________________________

    Need help? Help us help you.

    Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.

    Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.

    Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
    Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
    Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
    Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/

  • Just thought of giving a Update.

    The query is running with in the stipulated time.

    Nothing has changed over a period of time no server settings have changed not even query :doze:

    Has anybody faced this Issue. This is really puzzlling . What could be the root cause

  • Shadab Shah (1/10/2014)


    Just thought of giving a Update.

    The query is running with in the stipulated time.

    Nothing has changed over a period of time no server settings have changed not even query :doze:

    Has anybody faced this Issue. This is really puzzlling . What could be the root cause

    I have, indeed, run into such a thing. When it occurs, it's normally either due to a conflict with other things OR it's because the UPDATE is (what I call) an "illegal update". There is a particular form of the UPDATE statement that usually works but, in fact, is not mentioned anywhere in Books Online (which is why I call it "illegal").

    Please post the UPDATE statement that you were having troubles with so we can have a look.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

Viewing 6 posts - 1 through 5 (of 5 total)

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