Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQL Server slow with LIKE
Message
 
À
07/04/2008 16:43:13
Information générale
Forum:
ASP.NET
Catégorie:
Bases de données
Versions des environnements
Environment:
VB 8.0
OS:
Windows XP SP2
Database:
Visual FoxPro
Divers
Thread ID:
01308583
Message ID:
01308879
Vues:
9
>>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?
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform