A join is an SQL statement that links several tables with each other and returns a join table as its result.
The Optimizer's task is to find the optimal sequence for processing the tables. The Optimizer tries to access the rows of the new tables to be linked as directly as possible and to keep the size of the intermediate result tables to a minimum. For this reason, it starts by processing joins for the smallest tables with the most restrictive search conditions. Initially, this keeps the temporary results tables small.
The order in which the tables are specified in the FROM clause of the SELECT statement has no influence on the order of their processing.
The Optimizer can choose one of the following search strategies to access rows in the new table, starting from the join column values of the old temporary results table.
JOIN VIA MULTIPLE INDEXED COLUMNS
JOIN VIA RANGE OF MULTIPLE INDEXED COL.
JOIN VIA RANGE OF MULTIPLE KEY COLUMNS
If the two columns that you want to compare in a join step do not have the same column length, the Optimizer cannot use all of the abovementioned search strategies. To avoid this restriction, define the same value range for any columns that you want to join together.
You can use the EXPLAIN statement (EXPLAIN Statement for Joins) to find out the search strategy chosen by Optimizer.
See also:
Database parameter JOIN_SEARCH_LEVEL