SQL Server Performance

Is IN clause acceptable in query

Discussion in 'T-SQL Performance Tuning for Developers' started by s_niladri, Apr 10, 2006.

  1. s_niladri New Member

    Hello ALL,
    If I use IN caluse in my query will it be slow. Because I have heard
    that IN clause slow down the query . if it is what are the other alternatives
    so that performace can boost up.

    Regards


    Niladri
  2. Adriaan New Member

    What type of IN clause: value list or subquery?

    In both cases, it depends on the indexing - especially when it's a subquery with a WHERE statement.
  3. Madhivanan Moderator

    Also use exists and see the performance. or post the query you used

    Madhivanan

    Failing to plan is Planning to fail
  4. mmarovic Active Member

    You can test IN clause against exists (suggested by Madhivanan) or join combining in some cases with distinct. If it is just list of constants then use IN ,unless these values are increasing integers, in that case better use between.
  5. FrankKalis Moderator

Share This Page