Subject | Re: [firebird-support] Re: Firebird 2.1.x Indexing |
---|---|
Author | Helen Borrie |
Post date | 2008-09-18T21:22:59Z |
At 02:13 19/09/2008, you wrote:
...where aColumn in ('a', 'b') will use an index
but
......where aColumn in ('a') will not.
./heLen
>On Page 397, Expressions and Predicates, under Other ComparisonActually, 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.
>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. :)
...where aColumn in ('a', 'b') will use an index
but
......where aColumn in ('a') will not.
./heLen