Subject Re: [firebird-support] Re: select birthdays form the next several days
Author Arno Brinkman

> where bdate between bdateblahblah and bdateblahblah
> it is not uses the index on bdate.
> but
> when i use:
> ...
> where bdate>'01.01.1900' and
> bdate between bdateblahblah and bdateblahblah
> then it uses the index on bdate (Query PLAN reports)
> is this correct behaviour?

Yes, an index will be used to build a bitmap for dates where > '01.01.1900'.

> adding and extra condition helps to use index?

Because the condition is a constant and no expression with an other field from the same table.

> or there is a plan report problem ( natural+index scan? )

No, the "bdate between bdateblahblah and bdateblahblah" filter will be handled after internally the
records are fetched from disk.

Arno Brinkman

General database developer support:

Firebird open source database (based on IB-OE) with many SQL-99 features:

Support list for Interbase and Firebird users:

Nederlandse firebird nieuwsgroep: