Tuesday, March 3, 2015

Difference in terms of speed for SP and Query text.


Hi Visakh,


Actually I cannot modify the stored procedure that's why i copy the query inside and then i modify based on the requirement given by user instead of replicating the query again. By the way, I dont have any access or permission to modify the proc. I'll try to check the execution plan. thanks.





It may be the case that when SP is called, it finds the execution plan from procedure cache so SQL Server re-use it. However for your query there is no best plan in cache and it may take even longer to execute if you have ad-hoc queries or dynamic SQL.


-Vaibhav Chaudhari


No comments:

Post a Comment