Subject Re: ODP: [firebird-support] Question about index use
Author Carsten_Sch=c3=a4fer

Yes I'm sure.

With the left join FB does a full scan on Table_A and uses the Foreign Key index on Table_B. The index on table_B.field_B is not used at all.

So you get millions of reads if the table contains millions of data

With the inner join the index on  table_B.field_B is used and you only get 1 read (if It's only 1 row that matches the condition)

Is it possible to force the optimizer tu use the index on table_B.field_B?


Regards
Carsten


Am 06.03.2019 um 21:49 schrieb Karol Bieniaszewski liviuslivius@... [firebird-support]:
 

Are you sure that this query looks like this?

 

For me such query use indexes in both cases left and inner.

Show full example with plans

 

Regards,

Karol Bieniaszewski