Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
WHERE IN approach
Message
De
27/02/2017 17:54:19
 
 
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Versions des environnements
SQL Server:
SQL Server 2014
OS:
Windows 8.1
Network:
Windows Server 2012
Divers
Thread ID:
01648591
Message ID:
01648593
Vues:
33
>I normally use the second approach (e.g. IN) when the number of possibilities is limited (not a very long list)

I would have thought the other one. As for me, this is what led me to use the IN approach, thus the number of possibilities.

When I started to use the IN approach, it was for a specific query contained within an environment where the number of possibilities would be between 30 and 50. First of all, this makes the command quite long. So, the IN provides a cleaner and shorter command. But, it was only when there was so many choices. At first, under 5 or 6, I left the command as is. But, then, I adjusted it for the IN approach. Secondly, this is for performance. My query was based on a join table. So, this wasn't as fast as building the join values into a string and dumping that string inside the command itself. So, because the master table is big, this allowed to use faster queries as I eliminated a join clause. Then, today, I found the IN syntax is using a somewhat different execution plan. This is why I opened this discussion.
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform