Subject Re: [firebird-support] Foreign keys like index
Author Svein Erling Tysvaer
Sasa Mihajlovic wrote:
> Hi,
>
> I have a little newbie question for Firebird masters.
> If I have 2 tables (for example) orders and customers where orders
> are "slave" table for customers with foreign key on it.
>
> if I write statement like this:
>
> select c.name, c.city, o.orderno, o.orderdate
> from orders o
> join cutomers c on c.id = o.cutd_id
> order by c.name
>
> does firebird use foreign key like index

Firebird is likely to use an index ('index' meaning primary keys,
foreign keys, normal indexes etc.) for one of the tables, but since you
have no WHERE clause, it will have to go NATURAL on the other table.

If you prepare a statement, most tools will show you a plan (e.g.
IB_SQL, DB Workbench, IB Expert and probably FlameRobin).

HTH,
Set