I have search stored procedure which is my performance bottleneck.
In order to get control about what is happened, I added logging for all parameters and also execution time in SP.
I noticed, that when I call SP from MIcrosoft SQL server management Studio execution time is 1.3-1.6 seconds, but when i call it from C#, it takes 6-8 secods (!!!)
Parameters | Time (ms)
"tb *"TreeType:259Parents:212fL:13;14fV:0;lcid:2057min:0max:10sort:-1 | 6406
"tb *"TreeType:259Parents:212fL:13;14fV:0;lcid:2057min:0max:10sort:-1 | 1346
SP is called with LINQ. Login settings are same. SP uses full text search
What could cause this?
In order to locate such issues, the best tool is SQL Profiler, which records the exact call to database.
For me the difference was with novalue passed by SQL sample, which was substituted by '' and null value passed by C#.
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