Subject | Index question |
---|---|
Author | Christian Gütter |
Post date | 2003-11-26T21:39:30Z |
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
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