Determines join orderings based upon dependency and cost information
The algorithm works as follows:
Stage 1. Find join regions. A join region is an set of inner and cross joins
(with the join and intermediate criteria removed).
Stage 2. Determine if dependencies found can be satisfied.
a. Throw an exception if a quick check fails.
Stage 3. A satisfying set of access patterns and join ordering will be found
for each join region.
a. If this is not possible, an exception will be thrown
b. only one possible set of access patterns will be considered
Stage 4. Heuristically push joins down. Join regions (with more than one join source) will be
exhaustively searched (bottom up) for join pairs that can be pushed to a source.
a. A join is eligible for pushing if the access node can be raised and
there is at least one join criteria that can also be pushed.
-- costing information is not considered at this point.
b. Once a pair has been pushed, they will be replaced in the join region
with a single access node.
Stage 5. The remaining join regions will be ordered in a left linear tree based
upon a an exhaustive, or random, algorithm that considers costing and criteria information.