Subject | Re: MAX() and index |
---|---|
Author | Virgo Pärna |
Post date | 2015-09-07T17:37:58Z |
On Mon, 7 Sep 2015 14:00:27 +0100, Tim Ward tdw@... [firebird-support] <firebird-support@yahoogroups.com> wrote:
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@...
> Please can someone explain to me, again, whyBecause Firebird indexes are unidirectional - it cannot
>
> select Max(MYCOL) from MYTAB
>
> doesn't use the primary key
>
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@...