Subject [firebird-support] Indexes and Plans
Author Epstein, Ed
I have 2 different tables with a double precision field in each one. Both
are indexed. I am trying to perform a query of the values that are in both
tables.

I have tried many variations, but this is the most logical one to me:

SELECT * FROM TABLEA INNER JOIN TABLEB ON TABLEA.FIELD1 = TABLEB.FIELD1

The Plan that is generated for that is (TableA Natural,TableB (Index
TableB_Field1_A))

Wouldn't the best plan be to use both indexes?

When I try to specify the plan myself (TableA (Index TableA_Field1_A),TableB
(Index TableB_Field_A)) it says that I cannot
use TableA_Field_A. I have verified that it does indeed exist.

Basically I am trying to create the fastest query to return values from both
tables that are the same. So far it takes at least 2-5 minutes which is not
very good.