I have two DataBases
(DB1
& DB2
: both DBs are same, DB2
is created from the backup of DB1
). When I run a stored procedure SP1
on both DBs
it takes approximately 2 seconds to give me an output (select
statements) on both DBs
.
Now the problem is when I point these DBs
from a service
and try to use DataAdapter.Fill
method, it gives me different time(54 - 63 seconds on DB1
and 42 - 44 seconds on DB2
) on both DBs
consistently. Noted that I'm using same service to point DBs
so it couldn't be service behave/performance. Now my question is:
What could be the reason for this? Any suggestions are welcome that What should I look into?
Helping Info:
Both DB are on different
servers
(identical configuration) but since executing theSP
onSQL Server Management Studio
take the same time on bothDBs
so I ruled out the possibility ofDB
server
performance. Network delay could be a factor But higlly unlikely as bothservers
are on same network and infact on same physical location. This is my last option to check.Some other services are using
SQLDependency
ONDB1
. Which consistently fillDataAdapter(s)
, could this be the reason for myDataAdapter
fill
method to slow down? (less likely as I'm guessing)
As requested in comments below is code that is filling the DataSet
:
PS: The time mentioned above is the execution time of the code line highlighted in the above image.
That sounds very much like a query plan issue.
Erland Sommerskog has written an excellent article about this kind of problems, Slow in the Application, Fast in SSMS?.
My first guess would be "The Default Settings", but it might be one of the other issues, too.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With