Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
WHERE IN approach
Message
From
01/03/2017 09:31:34
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
01/03/2017 09:28:34
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Environment versions
SQL Server:
SQL Server 2014
OS:
Windows 8.1
Network:
Windows Server 2012
Miscellaneous
Thread ID:
01648591
Message ID:
01648666
Views:
24
>>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

Yes.
I don't understand why would EXISTS cannot utilise a compound index.
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform