SQL Server Performance Forum – Threads Archive
Execution time for web-executed vs. QA
Is it normal for queries to be *much* faster when executed in Query Analyzer? My situation is that a stored procedure is taking about 10 seconds to execute when called from a web application (according to Profiler) but the same sproc with the same parameter value executes instantly in Query Analyzer. Is this normal behavior?Thanks.
It depends on the layers of network and application connectivity between SQL & web servers.
In general the query execution in QA will take bit faster as compared to the layers of connection against SQL server. You can check execution performance by clearing the cache and recompile the plan from web app. & QA. Satya SKJ
Moderator
http://www.SQL-Server-Performance.Com/forum
This posting is provided “AS IS†with no rights for the sake of knowledge sharing.
The 10 seconds is what’s reported by SQL Profiler in the Duration column. That should be independent of any network lag, shouldn’t it? I thought that was just the sproc execution time but it seems strange that it should be so much slower than executing in QA. What do you mean by "recompile the plan"? Thanks.
run dbcc freeproccache and then run the query again.
SP_RECOMPILE to recompile the SP and update statistics on the invovled tables, refer books online for more information. Satya SKJ
Moderator
http://www.SQL-Server-Performance.Com/forum
This posting is provided “AS IS†with no rights for the sake of knowledge sharing.
]]>