Stored procedure called from C# executes 6 times longer than from SQL Management studio

Posted by Sergey Osypchuk on Stack Overflow See other posts from Stack Overflow or by Sergey Osypchuk
Published on 2010-12-11T20:28:29Z Indexed on 2010/12/23 17:54 UTC
Read the original article Hit count: 169

Filed under:
|
|

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?

© Stack Overflow or respective owner

Related posts about LINQ

Related posts about Performance