Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
WHERE IN approach
Message
De
01/03/2017 09:28:34
 
 
À
01/03/2017 09:24:59
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
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:
01648665
Vues:
25
>Yes, EXISTS is a potentially alternative route to take. Unlike inner join or IN ( select ... ) -which both need an aggregate phase-, EXISTS returns a boolean true on first hit and doesn't check the rest.
>Also, I would have those few provinces in their own table and check from there instead of searching them from a 200K or 2M records (they should be using it as foreign keys).

But, it still requires to check for existance on all master record found. Thus, depending on the result on the number of records, this will require additional checkups in the child table. The WHERE clause benefits of a compound index where the EXISTS cannot.

Is EXISTS still a better route? ...knowing those factors
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