Subject | Re: [firebird-support] Index question |
---|---|
Author | Ivan Prenosil |
Post date | 2003-11-26T23:19:49Z |
> ... and the following indices:Because it is not possible to order resultset using several indexes.
>
> 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))
You would have to create compound index
CREATE INDEX ... ON T_KUNDEN (FIRMA, NACHNAME);
Ivan