store procedure running problem

  • Hi All,

                 when we insert some data into table then we execute the procedure first time then it will take 2 min.next time it will executive the 1sec. Agian  next day we insert the data into table then exec the procedure it will take 2 min.
    what is the problem in my procedure.Here table and procedure in azure sql server database.

    Regards
    Polaiah

  • polo.csit - Thursday, July 27, 2017 7:40 AM

    Hi All,

                 when we insert some data into table then we execute the procedure first time then it will take 2 min.next time it will executive the 1sec. Agian  next day we insert the data into table then exec the procedure it will take 2 min.
    what is the problem in my procedure.Here table and procedure in azure sql server database.

    Regards
    Polaiah

    This is usually when a lot of data has to be brought to cache. Once the data and the execution plan are on cache the execution becomes very fast.

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • polo.csit - Thursday, July 27, 2017 7:40 AM

    Hi All,

                 when we insert some data into table then we execute the procedure first time then it will take 2 min.next time it will executive the 1sec. Agian  next day we insert the data into table then exec the procedure it will take 2 min.
    what is the problem in my procedure.Here table and procedure in azure sql server database.

    Regards
    Polaiah

    There is just nowhere near enough information here. Maybe the plan has to be recompiled, there could be a whole list of things here. We don't have the query, the table structure....pretty much nothing to go on.

    _______________________________________________________________

    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/

  • We need more information.  Could be a lot of things like data being loaded into cache...is it blocking that just seems to be happening at the same time...a crazy long compile of the sproc...etc.

    My guess is that it is two different query plans being executed between the first and second times.  Try capturing the plans and see if they are the same.

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

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