Subject Index question
Author Christian Gütter
Hi,

please take a look at the following table:

CREATE TABLE T_KUNDEN (
ID INTEGER NOT NULL,
KID INTEGER NOT NULL,
NACHNAME VARCHAR(80) COLLATE DE_DE,
FIRMA VARCHAR(80) COLLATE DE_DE,
[...]
);

... 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))
Adapted Plan
PLAN SORT ((T_KUNDEN NATURAL))

Any hints would be appreciated.


TIA,

Christian