Subject Re: [ib-support] Optimizer or De-optimizer ?
Author Ann W. Harrison
At 11:44 AM 3/21/2001 -0300, Carlos H. Cantu wrote:

>select a.*, f.forn_nome, f.forn_end
>from AQUISI a
>join forn f on f.cod_forn = a.cod_forn
>
>generated plan :
>
>PLAN JOIN (F NATURAL,A INDEX (RDB$FOREIGN57))
>
>f.cod_forn is the primary key of FORN. Why the optimizer isn't using the
>index in this simple join ????

Which table is larger, aquisi or forn?

One or the other must be accessed naturally since the
look-up value comes from the tables and is not presented
as part of the query. If you have an aquisi, you can find
forns. If you have a forn, you can find an aquisi. If
you have neither, you must start somewhere.

Or is there another problem?


Regards,

Ann
www.ibphoenix.com
We have answers.