Subject Re: [firebird-support] Best index for BETWEEN?
Author Dmitry Yemanov
Ann W. Harrison wrote:
>
> That query decomposes in the compiler into :something >= field1 and
> :something <= field2. You might think that a compound index would
> let you apply both predicates, but it doesn't (or at least it didn't
> when I was paying attention). The scan of an index has to be
> continuous - it can't skip over intermediate entries. If you have
> a compound index, Firebird will use only the first element in the
> index.
>
> So, subject to testing which should be pretty easy, I'd say two
> ascending indexes, one for each field.

Absolutely correct.


Dmitry