IN operator

  • 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?

  • 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.

  • 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

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply