Expand description
The JoinSelection rule tries to modify a given plan so that it can
accommodate infinite sources and utilize statistical information (if there
is any) to obtain more performant plans. To achieve the first goal, it
tries to transform a non-runnable query (with the given infinite sources)
into a runnable query by replacing pipeline-breaking join operations with
pipeline-friendly ones. To achieve the second goal, it selects the proper
PartitionMode and the build side using the available statistics for hash joins.
StructsΒ§
- Join
Selection - The
JoinSelectionrule tries to modify a given plan so that it can accommodate infinite sources and optimize joins in the plan according to available statistical information, if there is any.
FunctionsΒ§
- apply_
subrules π - Apply given
PipelineFixerSubrules to a given plan. This plan, along with auxiliary boundedness information, is in thePipelineStatePropagatorobject. - hash_
join_ πconvert_ symmetric_ subrule - Converts a hash join to a symmetric hash join if both its inputs are unbounded and incremental.
- hash_
join_ swap_ subrule - This subrule will swap build/probe sides of a hash join depending on whether one of its inputs may produce an infinite stream of records. The rule ensures that the left (build) side of the hash join always operates on an input stream that will produce a finite set of records. If the left side can not be chosen to be βfiniteβ, the join sides stay the same as the original query.
- partitioned_
hash_ πjoin - Creates a partitioned hash join execution plan, swapping inputs if beneficial.
- should_
swap_ πjoin_ order - Checks statistics for join swap.
- statistical_
join_ πselection_ subrule - This subrule tries to modify a given plan so that it can optimize hash and cross joins in the plan according to available statistical information.
- supports_
collect_ πby_ thresholds - swap_
join_ πaccording_ to_ unboundedness - This function swaps sides of a hash join to make it runnable even if one of
its inputs are infinite. Note that this is not always possible; i.e.
JoinType::Full,JoinType::Right,JoinType::RightAntiandJoinType::RightSemican not run with an unbounded left side, even if we swap join sides. Therefore, we do not consider them here. This function is crate public as it is useful for downstream projects to implement, or experiment with, their own join selection rules. - try_
collect_ πleft - Tries to create a
HashJoinExecinPartitionMode::CollectLeftwhen possible.
Type AliasesΒ§
- Pipeline
Fixer Subrule - Pipeline-fixing join selection subrule.