Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Avoiding parentheses
Message
De
12/10/2015 13:19:14
 
 
À
12/10/2015 13:08:53
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Versions des environnements
SQL Server:
SQL Server 2012
Application:
Web
Divers
Thread ID:
01624934
Message ID:
01625864
Vues:
39
>>if "NOT" it is the culprit
>>
>> WHERE Client.NoProvince=@NoProvince AND
>>  (Client.Status>=@Status   OR Client.NoStatus<>@NoStatus)  AND
>>  (Client.Status>=@Status2  OR Client.NoStatus<>@NoStatus2) AND
>>  (Client.Status>=@Status3  OR Client.NoStatus<>@NoStatus3) AND
>>  (Client.Status>=@Status4  OR Client.NoStatus<>@NoStatus4) AND
>> Client.NoCountry IN (1,2,3,4,5,6,7) AND
>> Client.FirstName LIKE @LXList1Clm_No
>>
>
>I verified the execution plan with the NOT approach and with yours. The execution plan is the same in both.
>
>So, I do not think I will be able to simplify thing ups using that approach.

My suggestion was purely aesthetic,
being the logical equivalent, it is very
unlikely that the plan executive changes.
You can try to using the optimization wizard,
and see if some statistics and some index provides
a most efficient plan.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform