Subject Re: MAX() and index
Author Virgo Pärna
On Mon, 7 Sep 2015 14:00:27 +0100, Tim Ward tdw@... [firebird-support] <firebird-support@yahoogroups.com> wrote:
> Please can someone explain to me, again, why
>
> select Max(MYCOL) from MYTAB
>
> doesn't use the primary key
>

Because Firebird indexes are unidirectional - it cannot
start from end and move backwards.
So in the case of ascending index it needs to do full
table scan.
But in the case of descending index it can use the index.

--
Virgo Pärna
virgo.parna@...