public void propagateBoostRemoval(VolcanoPlanner planner) { planner.ruleQueue.recompute(this); if (boosted) { boosted = false; for (RelNode parent : getParents()) { final RelSubset parentSubset = planner.getSubset(parent); parentSubset.propagateBoostRemoval(planner); } } }
public final void initialize( Map<VolcanoPlannerPhase, Set<String>> phaseRuleMap) { // Initialize subordinate's mappings. subordinate.initialize(phaseRuleMap); // Initialize our mappings. chainedInitialize(phaseRuleMap); }
public int compare(RelSubset o1, RelSubset o2) { int o1children = countChildren(o1); int o2children = countChildren(o2); int c = compare(o1children, o2children); if (c == 0) { // for determinism c = compare(o1.getId(), o2.getId()); } return c; }
/** * Rather than invoking the rule (as the base method does), creates a * {@link VolcanoRuleMatch} which can be invoked later. */ protected void onMatch() { final VolcanoRuleMatch match = new VolcanoRuleMatch( volcanoPlanner, getOperand0(), rels); volcanoPlanner.ruleQueue.addMatch(match); } }
public void propagateBoostRemoval(VolcanoPlanner planner) { planner.ruleQueue.recompute(this); if (boosted) { boosted = false; for (RelSubset parentSubset : getParentSubsets(planner)) { parentSubset.propagateBoostRemoval(planner); } } }
public RelNode copy(RelTraitSet traitSet, List<RelNode> inputs) { return new AbstractConverter( getCluster(), (RelSubset) sole(inputs), traitDef, traitSet); }
public RelOptCost multiplyBy(double factor) { if (this == INFINITY) { return this; } return new VolcanoCost(rowCount * factor, cpu * factor, io * factor); }
public long getRelMetadataTimestamp(RelNode rel) { RelSubset subset = getSubset(rel); if (subset == null) { return 0; } else { return subset.timestamp; } }
/** * Equivalent to {@link #recompute(RelSubset, boolean) recompute(subset, * false)}. */ public void recompute(RelSubset subset) { recompute(subset, false); }
/** * Recomputes the digest of this VolcanoRuleMatch. It is necessary when sets * have merged since the match was created. */ public void recomputeDigest() { digest = computeDigest(); }
/** * Creates an ExpandConversionRule. */ private ExpandConversionRule() { super(any(AbstractConverter.class)); }
VolcanoCost( double dRows, double dCpu, double dIo) { set(dRows, dCpu, dIo); }
public int compare(RelSubset o1, RelSubset o2) { int o1children = countChildren(o1); int o2children = countChildren(o2); int c = compare(o1children, o2children); if (c == 0) { // for determinism c = compare(o1.getId(), o2.getId()); } return c; }
/** * Rather than invoking the rule (as the base method does), creates a * {@link VolcanoRuleMatch} which can be invoked later. */ protected void onMatch() { final VolcanoRuleMatch match = new VolcanoRuleMatch( volcanoPlanner, getOperand0(), rels); volcanoPlanner.ruleQueue.addMatch(match); } }
public final void initialize( Map<VolcanoPlannerPhase, Set<String>> phaseRuleMap) { // Initialize subordinate's mappings. subordinate.initialize(phaseRuleMap); // Initialize our mappings. chainedInitialize(phaseRuleMap); }
public RelOptCost makeCost( double dRows, double dCpu, double dIo) { return new VolcanoCost(dRows, dCpu, dIo); }
public RelOptCost minus(RelOptCost other) { if (this == INFINITY) { return this; } VolcanoCost that = (VolcanoCost) other; return new VolcanoCost( this.rowCount - that.rowCount, this.cpu - that.cpu, this.io - that.io); }