Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL Server slow with LIKE
Message
From
08/04/2008 01:53:50
 
 
To
07/04/2008 16:47:34
General information
Forum:
ASP.NET
Category:
Databases
Environment versions
Environment:
VB 8.0
OS:
Windows XP SP2
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01308583
Message ID:
01308930
Views:
8
>>I don't know much about sqlserver (yet), but have you tried option 1 here
>>
>>1. "Disable" parameter sniffing by using local DECLARE'd variables that
>>you SET equal to the parameters inside the stored proc, and use the local
>>variables instead of the offending parameters in the queries. This is the
>>solution that you found yourself. SQL can't use parameter sniffing in
>>this case so it must make some guesses, but in this case the guess based
>>on average column density is better than the plan based on a specific but
>>"wrong" parameter value (NULL).
>>

>>http://groups.google.com/group/microsoft.public.sqlserver.server/browse_thread/thread/2c5c8472bff7dea0/ad37d8aec76e2b8f?lnk=st&q=#ad37d8aec76e2b8f
>
>Thanks for the link but I cannot use this approach.

Then, would this work - in fox like code which you'll have to translate
lparameters p1

local p2
p2 = p1  && maybe + '' or any other function so it cannot 'know' in advance what will be in p2

select ..... where (Name like m.p2)
Gregory
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform