Class LoptSemiJoinOptimizer

java.lang.Object
org.apache.calcite.rel.rules.LoptSemiJoinOptimizer

public class LoptSemiJoinOptimizer extends Object
Implements the logic for determining the optimal semi-joins to be used in processing joins in a query.
  • Constructor Details

  • Method Details

    • makePossibleSemiJoins

      public void makePossibleSemiJoins(LoptMultiJoin multiJoin)
      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

      public boolean chooseBestSemiJoin(LoptMultiJoin multiJoin)
      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

      public RelNode getChosenSemiJoin(int factIdx)
      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