Is IN clause acceptable in query | SQL Server Performance Forums

SQL Server Performance Forum – Threads Archive

Is IN clause acceptable in query

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
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.
Also use exists and see the performance. or post the query you used Madhivanan Failing to plan is Planning to fail
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.
See if this helps:
Frank Kalis
Microsoft SQL Server MVP
Heute schon gebloggt?
Ich unterstuetze PASS Deutschland e.V.