Monday, June 30, 2014

Parameter-less query if fast, but slow in procedure

Do you have many set options in your stored procedure? Are you facing this issue in only one environment or is it reproducible ?


Have you tried running the stored procedure with recompile clause , so that it uses a new plan for the stored procedure? May be the plan which is in the cache might not be the best plan for this stored procedure.


Do you know the waittype of the stored procedure execution?


Could you see if the plans for the query and stored procedure has a major difference?




Regards, Ashwin Menon My Blog - http:\\sqllearnings.com


No comments:

Post a Comment