Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Performance switched with parameter
Message
De
20/09/2014 19:54:55
Walter Meester
HoogkarspelPays-Bas
 
 
À
20/09/2014 14:17:12
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Indexation
Versions des environnements
SQL Server:
SQL Server 2012
Application:
Web
Divers
Thread ID:
01607903
Message ID:
01607910
Vues:
59
>>The optimizer is not always able to optimize a query in the optimal way if you set the parameters in the script. Usually this does go ok when using parameterized Queries.
>>
>>Perhaps eliminating the OR with IN() resolves the problem
>
>Thanks for the suggestion but this was tested an hour ago with same result.

ok, let me ask the question. Why are you setting the values in the script? Can't you set the values through parameters (instead of using variables)? SQL server is able to do parameter sniffing and use that to optimize the plan.

If you have to do it through a script it might be an idea to use the sp_executesql stored procedure which in itself will start another optimization round.

Walter,
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform