Subject Re: [firebird-support] Index question
Author Ivan Prenosil
> ... and the following indices:
>
> CREATE INDEX T_KUNDEN_FIRMA ON T_KUNDEN (FIRMA);
> CREATE INDEX T_KUNDEN_NACHNAME ON T_KUNDEN (NACHNAME);
>
> ... and the following select statement:
>
> SELECT * FROM T_KUNDEN
> ORDER BY FIRMA ASC, NACHNAME ASC
>
> Why does Firebird ignore the indices and uses the following plan?
>
> Plan
> PLAN SORT ((T_KUNDEN NATURAL))

Because it is not possible to order resultset using several indexes.
You would have to create compound index

CREATE INDEX ... ON T_KUNDEN (FIRMA, NACHNAME);

Ivan