If we join two table we can guess which index is used for the query.
But when a table is joined more than two tables based on different columns, which indexes are used?
According to the example below;
Assume that 3 indexes are defined on table A.
index_1 is defined on column1,
index_2 is defined on column2
and index_3 is defined on both column1 and column2 as composite index.
Which index is used by query optimizer for joining table A?
select * from
A inner join B
on A.column1=B.column1
inner join C
on B.column2=C.column1 and A.column2=C.column2