• Rune Bivrin (1/27/2010)


    This used to be true, and I have often used this knowledge to optimise slow-running queries. But since SQL 2005 it no longer matters from a performance point of view.

    I checked this on SQL Server 2000 (SP4, 8.00.2039) and it produced fully identical execution plans. Seems like the database engine 2000 is smart enough 🙂 Maybe this was one of the improvements in Service Pack 4.

    Carlo Romagnano (1/27/2010)


    FROM BOL:

    Including an extremely large number of values (many thousands) in an IN clause can consume resources and return errors 8623 or 8632.

    This may happen only when a list of values is used in the IN statement. The author used a subquery, so it's O.K.