I have an application that query set of records from sql server 2008 database, the performance is good when there is sleep between each data request (set of queries) than without sleeping. The following is the pesudo code for my scenario:
for i =1 to end
GetData
Process
//adding sleep here gives better performance
I have run the sql profiler and found that the same queries take much time if the application executes without sleep. I am using C# on .Net 3.5 and sql server 2008 Can you explain why?
P.S
The SQL sever is on another machine, no one work on this machine during my test, I request data over network from WCF service that makes local queries, process and return results, SQL profiler gives me the execution time of each query and it is high when there is no sleep in my application