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

I have a stored search procedure, which is my performance bottleneck.

To gain control over what happened, I added registration for all parameters, as well as runtime in SP.

I noticed that when I call SP from MIcrosoft SQL server management, the Studio run time is 1.3-1.6 seconds, but when I call it from C #, it takes 6-8 seconds (!!!)

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 invoked with LINQ. Login settings are the same. SP uses full-text search

What could be the reason for this?

+5
source share
1 answer

, SQL Profiler, .

, novalue SQL, '' null, #.

+2

All Articles