Subject Re: [firebird-support] Not using index for MAX
Author Alexandre Benson Smith
Erick Sasse wrote:
> If I have a integer PK and do a "SELECT MAX(MY_PK_FIELD) FROM MYTABLE"
> it doesn't use the index to find the max value, why?
>
> Thanks.
>
>
Because you have an ASCENDING index on MY_PK_FIELD, create a DESCENDING
index on MY_PK_FIELD and it would be used.

see you !

--
Alexandre Benson Smith
Development
THOR Software e Comercial Ltda
Santo Andre - Sao Paulo - Brazil
www.thorsoftware.com.br