Query performance
-
I have a stored procedure with two params in sql2005. If I excute the stored procedure it takes 2 min but i copied the same query in new window, declare variables and run the query it takes 1sec. What is the problem.
-
I have a stored procedure with two params in sql2005. If I excute the stored procedure it takes 2 min but i copied the same query in new window, declare variables and run the query it takes 1sec. What is the problem.
-
I have a stored procedure with two params in sql2005. If I excute the stored procedure it takes 2 min but i copied the same query in new window, declare variables and run the query it takes 1sec. What is the problem.
-
I have a stored procedure with two params in sql2005. If I excute the stored procedure it takes 2 min but i copied the same query in new window, declare variables and run the query it takes 1sec. What is the problem.
-
Whenever I hear of a query taking longer in a stored procedure, I believe it usually ends up being due to something called "parameter sniffing" - see http://blogs.msdn.com/b/queryoptteam/archive/2006/03/31/565991.aspx[^]. Scott
Good info!
"When did ignorance become a point of view" - Dilbert
-
Whenever I hear of a query taking longer in a stored procedure, I believe it usually ends up being due to something called "parameter sniffing" - see http://blogs.msdn.com/b/queryoptteam/archive/2006/03/31/565991.aspx[^]. Scott
Thank you, I've been looking for that article for ages, it (or a similar article) was posted some time ago as a similar response and I didn't grab it then.
Never underestimate the power of human stupidity RAH
-
Whenever I hear of a query taking longer in a stored procedure, I believe it usually ends up being due to something called "parameter sniffing" - see http://blogs.msdn.com/b/queryoptteam/archive/2006/03/31/565991.aspx[^]. Scott
A friend of mine just informed me about that this week. :thumbsup:
-
I have a stored procedure with two params in sql2005. If I excute the stored procedure it takes 2 min but i copied the same query in new window, declare variables and run the query it takes 1sec. What is the problem.
When you encounter such a performance difference, does it then matter, which one was executed first? Or in other words: is the stored procedure faster after you run the normal query? SQL Server can cache execution plans and results, maybe that's the issue here.