Friday 15 February 2013

sql - Stored Procedure(s) slow on initial execution -


Groups, I'm still learning SQL, and I'm running into a new problem. I have some stored procedures that are slow on their initial execution / connection. For example, I have a stored procedure (SP) that I use in an application to view prices for a product. The first time I run the SP in the morning, it may have to be executed for 20-40 seconds. After that it takes only 1-2 seconds ... we also run daily updates on the tables used by SP (SA) and after the update the cache is cleared and then it will be used for initial run of 20-40 seconds And then 1-2 seconds later.

Is there a way around this? Not sure if I should add my SP to Daily Update after update (which may be messed up) or if I can add anything to my SP who does not want to clear the cache (which creates space issues Can do).

Any suggestions are very appreciated.

Text "itemproc =" text ">

Possible reasons are you see the difference in speed due to caching. Once you run an SPCR, the execution plan goes into the cache and it is very fast. Whatever was done in its environment, it was used to run its more used spros as a fixed work for around 7:30 so that they could start their workday For "hot" at 8 o'clock.


No comments:

Post a Comment