Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL Server slow with LIKE
Message
 
To
07/04/2008 16:43:13
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:
01308879
Views:
8
>>Did you try something like:
>>
>>SELECT .. WHERE myField = MyPar or MyField LIKE myPar + '%'
>>
>>Was the speed better?
>
>No, this doesn't change anything. To support this parameterized approach in regards to performance issue, I will have to use the text indexation as described by Rick. When I do it by putting the value as is in the SQL, it is an immediate result. So, because everything is parameterized, in order to avoid this downsize effect, I will look into the text indexation.

I'm not sure what you mean by parameterized. You mean use a named parameter for the Like value?

There should only be a tiny performance hit compared to static text and then only on the first hit as the query compiles. THere's no reason that a prepared statement should be noticably slower than a static query.

Something else is going on in your query. Get out Profiler and capture both queries then stick it into Query Analyzer and compare the execution plans.
+++ Rick ---

West Wind Technologies
Maui, Hawaii

west-wind.com/
West Wind Message Board
Rick's Web Log
Markdown Monster
---
Making waves on the Web

Where do you want to surf today?
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform