Entering content frame

Function documentation Joins Locate the document in the library structure

Use

A join is an SQL statement that links several tables with each other and returns a join table as its result.

Features

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.

Note

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.

Search Strategies for Joins

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 INDEXED COLUMN

JOIN VIA KEY COLUMN

JOIN VIA KEY RANGE

JOIN VIA MULTIPLE INDEXED COLUMNS

JOIN VIA MULTIPLE KEY 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.

Note

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

 

Leaving content frame