Function mz_sql::plan::lowering::attempt_outer_equijoin
source ยท fn attempt_outer_equijoin(
left: MirRelationExpr,
right: MirRelationExpr,
on: MirScalarExpr,
on_subquery_types: Vec<ColumnType>,
kind: JoinKind,
oa: usize,
id_gen: &mut IdGen,
context: &Context<'_>,
) -> Result<Option<MirRelationExpr>, PlanError>
Expand description
Attempts an efficient outer join, if on
has equijoin structure.
Both left
and right
are decorrelated inputs.
The first oa
columns correspond to an outer context: we should do the
outer join independently for each prefix. In the case that on
contains
just some equality tests between columns of left
and right
and some
local predicates, we can employ a relatively simple plan.
The last on_subquery_types.len()
columns correspond to results from
subqueries defined in the on
clause - we treat those as theta-join
conditions that prohibit the use of the simple plan attempted here.