Join order examples

The optimizer could select among several plans for this three-way join query:

select * 
from t1, t2, t3
where c11 = c21 
    and c12 = c31
    and c22 = 0
    and c32 = 100

Here are a few examples:

All of these plans completely constrain the choice of join order, letting the optimizer choose the type of join.

The generic g_join operator implements outer joins, inner joins, and existence joins. For examples of flattened subqueries that perform existence joins, see “Flattened subqueries”.