Subject | query plan |
---|---|
Author | cpis20022002 |
Post date | 2004-01-20T20:38:24Z |
Hi Firebird people
I have this select, and I want ask you, why then
the first select don't use the index (id is the primary key)
SELECT SUM(encomendas.qtdtotal) FROM encomendas
WHERE id in (SELECT idenc FROM encgrupolin WHERE id=:xpto)
Plan
PLAN (ENCGRUPOLIN INDEX (RDB$FOREIGN214,FK_ENCGRUPOLIN_ENCOMENDAS))
PLAN (ENCOMENDAS NATURAL)
The in clause don't use indexes?
Thanks
Agostinho
cpis@...
I have this select, and I want ask you, why then
the first select don't use the index (id is the primary key)
SELECT SUM(encomendas.qtdtotal) FROM encomendas
WHERE id in (SELECT idenc FROM encgrupolin WHERE id=:xpto)
Plan
PLAN (ENCGRUPOLIN INDEX (RDB$FOREIGN214,FK_ENCGRUPOLIN_ENCOMENDAS))
PLAN (ENCOMENDAS NATURAL)
The in clause don't use indexes?
Thanks
Agostinho
cpis@...