Stored procedure called from C# executes 6 times longer than from SQL Management studio
- by Sergey Osypchuk
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?