November 15, 2012 at 9:47 pm
Hi all,
While reading an article from http://www.sql-server-performance.com. They said "The Query Optimizer converts the Transact-SQL IN clause to the OR operator when parsing your code". Is is correct?
November 15, 2012 at 9:57 pm
Write your query both ways and look at the execution plan.
It is best to use articles and/or advice on forums as guidance to figure things out and confirm stuff for yourself.
November 16, 2012 at 1:53 am
Providing it's IN with a list of values, yes. Trivial to prove, just look at the seek predicate/predicate on the index seek/scan in the exec plan
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy