There are search conditions linked with OR. The system analyzes the individual search conditions.
If the system finds an equality condition for key columns, it ignores the other search conditions linked with OR.
If the system does not find any equality conditions for key columns, the other search conditions linked with OR, that the system has not considered until then, are analyzed.
...
1.
Conversion of
the search condition into the disjunctive normal form
Example:
b1 and b2 and (b3 or b4 and b5)
results in the disjunctive normal form
(b1 and b2 and b3) or (b1 and b2 and b4 and b5)
2.
Analysis of
the new expression
Every bracketed expression is analyzed separately.
If the analysis of
the first expression results in the best search strategy, this is
used. However, if the analysis of each bracketed
expression provides a better search strategy, there are usually as many search
strategies as there are bracketed expressions that have been
analyzed.
3.
Cost
determination
The costs of the various search strategies are added together. If the
total is lower than the determined cost for the search strategy without
consideration of the search conditions linked with OR, the various search
strategies are used.
If applicable, the EXPLAIN statement displays the search strategy DIFFERENT STRATEGIES FOR OR-TERMS.