Package | Description |
---|---|
org.apache.calcite.rel.rules |
Provides a core set of planner rules.
|
Modifier and Type | Method and Description |
---|---|
private void |
LoptOptimizeJoinRule.addAdditionalFilters(RelBuilder relBuilder,
LoptMultiJoin multiJoin,
LoptJoinTree left,
LoptJoinTree right,
java.util.List<RexNode> filtersToAdd)
Determines whether any additional filters are applicable to a join tree.
|
private LoptJoinTree |
LoptOptimizeJoinRule.addFactorToTree(RelMetadataQuery mq,
RelBuilder relBuilder,
LoptMultiJoin multiJoin,
LoptSemiJoinOptimizer semiJoinOpt,
LoptJoinTree joinTree,
int factorToAdd,
java.util.BitSet factorsNeeded,
java.util.List<RexNode> filtersToAdd,
boolean selfJoin)
Adds a new factor into the current join tree.
|
private RexNode |
LoptOptimizeJoinRule.addFilters(LoptMultiJoin multiJoin,
LoptJoinTree leftTree,
int leftIdx,
LoptJoinTree rightTree,
java.util.List<RexNode> filtersToAdd,
boolean adjust)
Determines which join filters can be added to the current join tree.
|
private LoptJoinTree |
LoptOptimizeJoinRule.addToTop(RelMetadataQuery mq,
RelBuilder relBuilder,
LoptMultiJoin multiJoin,
LoptSemiJoinOptimizer semiJoinOpt,
LoptJoinTree joinTree,
int factorToAdd,
java.util.List<RexNode> filtersToAdd,
boolean selfJoin)
Creates a join tree with the new factor added to the top of the tree
|
private RexNode |
LoptOptimizeJoinRule.adjustFilter(LoptMultiJoin multiJoin,
LoptJoinTree left,
LoptJoinTree right,
RexNode condition,
int factorAdded,
java.util.List<java.lang.Integer> origJoinOrder,
java.util.List<RelDataTypeField> origFields)
Adjusts a filter to reflect a newly added factor in the middle of an
existing join tree
|
private RexNode |
LoptSemiJoinOptimizer.adjustSemiJoinCondition(LoptMultiJoin multiJoin,
int leftAdjustment,
RexNode semiJoinCondition,
int leftIdx,
int rightIdx)
Modifies the semijoin condition to reflect the fact that the RHS is now
the second factor into a join and the LHS is the first
|
boolean |
LoptSemiJoinOptimizer.chooseBestSemiJoin(LoptMultiJoin multiJoin)
Finds the optimal semijoin for filtering the least costly fact table from
among the remaining possible semijoins to choose from.
|
private java.lang.Double |
LoptOptimizeJoinRule.computeJoinCardinality(RelMetadataQuery mq,
LoptMultiJoin multiJoin,
LoptSemiJoinOptimizer semiJoinOpt,
LoptJoinTree joinTree,
java.util.List<RexNode> filters,
int factor)
Computes the cardinality of the join columns from a particular factor,
when that factor is joined with another join tree.
|
private LoptJoinTree |
LoptOptimizeJoinRule.createJoinSubtree(RelMetadataQuery mq,
RelBuilder relBuilder,
LoptMultiJoin multiJoin,
LoptJoinTree left,
LoptJoinTree right,
RexNode condition,
JoinRelType joinType,
java.util.List<RexNode> filtersToAdd,
boolean fullAdjust,
boolean selfJoin)
Creates a LogicalJoin given left and right operands and a join condition.
|
private LoptJoinTree |
LoptOptimizeJoinRule.createOrdering(RelMetadataQuery mq,
RelBuilder relBuilder,
LoptMultiJoin multiJoin,
LoptSemiJoinOptimizer semiJoinOpt,
int firstFactor)
Generates a join tree with a specific factor as the first factor in the
join tree
|
private LoptJoinTree |
LoptOptimizeJoinRule.createReplacementJoin(RelBuilder relBuilder,
LoptMultiJoin multiJoin,
LoptSemiJoinOptimizer semiJoinOpt,
LoptJoinTree currJoinTree,
int leftIdx,
int factorToAdd,
ImmutableIntList newKeys,
java.lang.Integer[] replacementKeys,
java.util.List<RexNode> filtersToAdd)
Creates a replacement join, projecting either dummy columns or
replacement keys from the factor that doesn't actually need to be joined.
|
private LoptJoinTree |
LoptOptimizeJoinRule.createReplacementSemiJoin(RelBuilder relBuilder,
LoptMultiJoin multiJoin,
LoptSemiJoinOptimizer semiJoinOpt,
LoptJoinTree factTree,
int dimIdx,
java.util.List<RexNode> filtersToAdd)
In the event that a dimension table does not need to be joined because of
a semijoin, this method creates a join tree that consists of a projection
on top of an existing join tree.
|
private RelNode |
LoptOptimizeJoinRule.createTopProject(RelBuilder relBuilder,
LoptMultiJoin multiJoin,
LoptJoinTree joinTree,
java.util.List<java.lang.String> fieldNames)
Creates the topmost projection that will sit on top of the selected join
ordering.
|
private void |
LoptOptimizeJoinRule.findBestOrderings(RelMetadataQuery mq,
RelBuilder relBuilder,
LoptMultiJoin multiJoin,
LoptSemiJoinOptimizer semiJoinOpt,
RelOptRuleCall call)
Generates N optimal join orderings.
|
private void |
LoptOptimizeJoinRule.findRemovableOuterJoins(RelMetadataQuery mq,
LoptMultiJoin multiJoin)
Locates all null generating factors whose outer join can be removed.
|
private void |
LoptOptimizeJoinRule.findRemovableSelfJoins(RelMetadataQuery mq,
LoptMultiJoin multiJoin)
Locates pairs of joins that are self-joins where the join can be removed
because the join condition between the two factors is an equality join on
unique keys.
|
private LogicalJoin |
LoptSemiJoinOptimizer.findSemiJoinIndexByCost(LoptMultiJoin multiJoin,
java.util.List<RexNode> joinFilters,
int factIdx,
int dimIdx)
Given a list of possible filters on a fact table, determine if there is
an index that can be used, provided all the fact table keys originate
from the same underlying table.
|
private int |
LoptOptimizeJoinRule.getBestNextFactor(RelMetadataQuery mq,
LoptMultiJoin multiJoin,
java.util.BitSet factorsToAdd,
java.util.BitSet factorsAdded,
LoptSemiJoinOptimizer semiJoinOpt,
LoptJoinTree joinTree,
java.util.List<RexNode> filtersToAdd)
Determines the best factor to be added next into a join tree.
|
private java.util.Map<java.lang.Integer,RelOptTable> |
LoptOptimizeJoinRule.getSimpleFactors(RelMetadataQuery mq,
LoptMultiJoin multiJoin)
Retrieves join factors that correspond to simple table references.
|
private boolean |
LoptOptimizeJoinRule.isSelfJoinFilterUnique(RelMetadataQuery mq,
LoptMultiJoin multiJoin,
int leftFactor,
int rightFactor,
java.util.List<RexNode> joinFilterList)
Determines if the equality join filters between two factors that map to
the same table consist of unique, identical keys.
|
private int |
LoptSemiJoinOptimizer.isSuitableFilter(LoptMultiJoin multiJoin,
RexNode joinFilter,
int factIdx)
Determines if a join filter can be used with a semijoin against a
specified fact table.
|
void |
LoptSemiJoinOptimizer.makePossibleSemiJoins(LoptMultiJoin multiJoin)
Determines all possible semijoins that can be used by dimension tables to
filter fact tables.
|
private boolean |
LoptOptimizeJoinRule.needsAdjustment(LoptMultiJoin multiJoin,
int[] adjustments,
LoptJoinTree joinTree,
LoptJoinTree otherTree,
boolean selfJoin)
Sets an array indicating how much each factor in a join tree needs to be
adjusted to reflect the tree's join ordering
|
private LoptJoinTree |
LoptOptimizeJoinRule.pushDownFactor(RelMetadataQuery mq,
RelBuilder relBuilder,
LoptMultiJoin multiJoin,
LoptSemiJoinOptimizer semiJoinOpt,
LoptJoinTree joinTree,
int factorToAdd,
java.util.BitSet factorsNeeded,
java.util.List<RexNode> filtersToAdd,
boolean selfJoin)
Creates a join tree where the new factor is pushed down one of the
operands of the current join tree
|
private boolean |
LoptOptimizeJoinRule.remapJoinReferences(LoptMultiJoin multiJoin,
int factor,
java.util.List<java.lang.Integer> newJoinOrder,
int newPos,
int[] adjustments,
int offset,
int newOffset,
boolean alwaysUseDefault)
Sets an adjustment array based on where column references for a
particular factor end up as a result of a new join ordering.
|
private void |
LoptSemiJoinOptimizer.removeJoin(LoptMultiJoin multiJoin,
LogicalJoin semiJoin,
int factIdx,
int dimIdx)
Determines whether a join of the dimension table in a semijoin can be
removed.
|
private void |
LoptOptimizeJoinRule.setFactorJoinKeys(LoptMultiJoin multiJoin,
java.util.List<RexNode> filters,
ImmutableBitSet joinFactors,
int factorStart,
int nFields,
ImmutableBitSet.Builder joinKeys)
Locates from a list of filters those that correspond to a particular join
tree.
|
private RexNode |
LoptOptimizeJoinRule.swapFilter(RexBuilder rexBuilder,
LoptMultiJoin multiJoin,
LoptJoinTree origLeft,
LoptJoinTree origRight,
RexNode condition)
Adjusts a filter to reflect swapping of join inputs
|
private boolean |
LoptOptimizeJoinRule.swapInputs(RelMetadataQuery mq,
LoptMultiJoin multiJoin,
LoptJoinTree left,
LoptJoinTree right,
boolean selfJoin)
Swaps the operands to a join, so the smaller input is on the right.
|
Constructor and Description |
---|
LoptSemiJoinOptimizer(RelMetadataQuery mq,
LoptMultiJoin multiJoin,
RexBuilder rexBuilder) |
Copyright © 2012–2019 The Apache Software Foundation. All rights reserved.