I have a strange issue where I get the following error when executing a query that returns a smaller dataset (and runs faster) than executing the same query and having it return a larger dataset (and the runtime is sometimes higher).
Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.
I am passing in a set of options to a sproc. When the set of options does not include options which would trigger more table joins and a larger result s开发者_Go百科et, the aforementioned exception is raised. I thought I had resolved this earlier by increasing the Connection Timeout property in the connection string, but it appears that is not the case.
Does anyone know how I can go about troubleshooting this? I've gone through SQL profiler and ran the query using both the smaller and larger inputs and the results are as expected. With the smaller input the query runs significantly faster (but times out on the client) and with the larger query it runs slower (but returns the result to the client).
just for performance point of view, add with (nolock) with every query to minimize the chances of dead lock (am assuming that there is a chance of dead lock)
精彩评论