I know that in SO is lot of this kind of topics, but would like to introduce to my concrete example.
When running action from web app (ADO.NET, ASP.NET MVC) getting error: Timeout expired. The timeout period elapsed prior to completion of the operation or the server. The wait operation timed out
But from the second hand when running directly on db raw query (captured by profiler) taking only 2 seconds.
Background:
Advices:
Found lot similar posts, this one looks especially interesting for me: https://stackoverflow.com/a/8603111 , and wondering about clearing statistics (exec sp_updatestats).
Question:
Do you have similar experiences, maybe any others advices as suggested above? What can be the reason that raw query running in short time, but from webapp getting timeout?
This is most likely caused by different execution plans cached for different options.
Have a look at these questions:
and
Why is some sql query much slower when used with SqlCommand?
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.