The special database parameter JOIN_SEARCH_LEVEL specifies the algorithm for the join sequence search. This parameter therefore determines how long the search takes and how many resources it uses.
You can specify the algorithm that you want to use directly or it can be calculated from the JOIN_MAXTAB_LEVEL4 and JOIN_MAXTAB_LEVEL9 parameters, and the number of tables in the join.
To specify the algorithm directly, enter one of the following values for JOIN_SEARCH_LEVEL:
· 9: All possible join sequences are calculated (permutation algorithm).
· 4: Various join sequences are calculated, depending on the query structure (transformer algorithm).
· 1: The simplest algorithm is used for the join sequence search (greedy algorithm).
If you enter 0 as the JOIN_SEARCH_LEVEL, then the algorithm for the join sequence search is specified as follows:
Join table number n |
Algorithm |
n = JOIN_MAXTAB_LEVEL9 |
9 |
JOIN_MAXTAB_LEVEL9 <n = JOIN_MAXTAB_LEVEL4 |
4 |
JOIN_MAXTAB_LEVEL4 < n |
1 |
JOIN_SEARCH_LEVEL is set to 0.
JOIN_MAXTAB_LEVEL4 is set to 16.
JOIN_MAXTAB_LEVEL9 is set to 4.
Five tables are used for a join.
Join sequence search level 4 (transformer algorithm) is used for this join because JOIN_MAXTAB_LEVEL9 < 5 = JOIN_MAXTAB_LEVEL4 applies.