Subject Re: [firebird-support] Re: Firebird 2.1.x Indexing
Author Helen Borrie
At 02:13 19/09/2008, you wrote:

>On Page 397, Expressions and Predicates, under Other Comparison
>Predicators, there is a CAUTION block that starts:
>
>[It is a common "newbie" mistake to treat the predicate "IN (<value>)"
>as if it were equivalent to "= <value>" because the two are logically
>equivalent, insofar as both return the same result. However, IN()
>does not use an index. ...]
>
>If that's incorrect, I hope it helps you track down the affending
>characters and give them a good talking too. :)

Actually, although the optimizer has undergone a lot of changes since Fb 1.5 to make sense of "unsmart" SQL, I think this is still true of IN() when used in the context that the caution refers to...i.e.

...where aColumn in ('a', 'b') will use an index
but
......where aColumn in ('a') will not.

./heLen