I have a query that joins some tables and when I use =
operator instead of in
operator in a where clause like this I get a significant performance improvement.
=
operator takes less than a second.in
operator takes about a minute.
where P.GID in ( SELECT GID from [dbo].[fn_SomeFunction] (15268) )
the sub query returns 1 result in most of the cases and just this change will improve most of the cases but will cause errors for some other cases.
any ideas why this behavior?