Module join_selection

Module join_selection 

Source
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Β§

JoinSelection
The JoinSelection rule 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 the PipelineStatePropagator object.
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::RightAnti and JoinType::RightSemi can 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 HashJoinExec in PartitionMode::CollectLeft when possible.

Type AliasesΒ§

PipelineFixerSubrule
Pipeline-fixing join selection subrule.