Subject Re: [firebird-support] Natural plan still used when index exists
Author Lucas Franzen
Ed,

> Then I created an index on LastUpdated:
>
> Create Index TableNameIdx1 on TableName(LastModified);
>
> and when I rerand the select max()... against it, it is still using
> the natural plan:
>
> Plan
> PLAN (TAXYEAR NATURAL)
>
> Adapted Plan
> PLAN (TAXYEAR NATURAL) // Why natural if an index exists?

Because you created an ascending index.
If you ask for MAX () you should have an descending index.


Luc.