Subject | Re: [firebird-support] Best index for BETWEEN? |
---|---|
Author | Milan Babuskov |
Post date | 2008-10-16T13:30:12Z |
Dmitry Yemanov wrote:
--
Milan Babuskov
http://www.flamerobin.org
http://www.guacosoft.com
> Ann W. Harrison wrote:Thank you both for your answers.
>> 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.
>
> Absolutely correct.
--
Milan Babuskov
http://www.flamerobin.org
http://www.guacosoft.com