Package org.apache.calcite.rel.rules
Class LoptSemiJoinOptimizer
java.lang.Object
org.apache.calcite.rel.rules.LoptSemiJoinOptimizer
Implements the logic for determining the optimal
semi-joins to be used in processing joins in a query.
-
Constructor Summary
ConstructorDescriptionLoptSemiJoinOptimizer
(RelMetadataQuery mq, LoptMultiJoin multiJoin, RexBuilder rexBuilder) -
Method Summary
Modifier and TypeMethodDescriptionboolean
chooseBestSemiJoin
(LoptMultiJoin multiJoin) Finds the optimal semijoin for filtering the least costly fact table from among the remaining possible semijoins to choose from.getChosenSemiJoin
(int factIdx) Returns the optimal semijoin for the specified factor; may be the factor itself if semijoins are not chosen for the factor.void
makePossibleSemiJoins
(LoptMultiJoin multiJoin) Determines all possible semijoins that can be used by dimension tables to filter fact tables.
-
Constructor Details
-
LoptSemiJoinOptimizer
-
-
Method Details
-
makePossibleSemiJoins
Determines all possible semijoins that can be used by dimension tables to filter fact tables. Constructs SemiJoinRels corresponding to potential dimension table filters and stores them in the member field "possibleSemiJoins"- Parameters:
multiJoin
- join factors being optimized
-
chooseBestSemiJoin
Finds the optimal semijoin for filtering the least costly fact table from among the remaining possible semijoins to choose from. The chosen semijoin is stored in the chosenSemiJoins array- Parameters:
multiJoin
- join factors being optimized- Returns:
- true if a suitable semijoin is found; false otherwise
-
getChosenSemiJoin
Returns the optimal semijoin for the specified factor; may be the factor itself if semijoins are not chosen for the factor.- Parameters:
factIdx
- Index corresponding to the desired factor
-