public RelOptCost getCumulativeCost(HiveJoin rel, RelMetadataQuery mq) { RelOptCost cost = mq.getNonCumulativeCost(rel); List<RelNode> inputs = rel.getInputs(); RelOptCost maxICost = HiveCost.ZERO; for (RelNode input : inputs) { RelOptCost iCost = mq.getCumulativeCost(input); if (maxICost.isLt(iCost)) { maxICost = iCost; } } return cost.plus(maxICost); } }
public RelOptCost getCumulativeCost(HiveJoin rel, RelMetadataQuery mq) { RelOptCost cost = mq.getNonCumulativeCost(rel); List<RelNode> inputs = rel.getInputs(); RelOptCost maxICost = HiveCost.ZERO; for (RelNode input : inputs) { RelOptCost iCost = mq.getCumulativeCost(input); if (maxICost.isLt(iCost)) { maxICost = iCost; } } return cost.plus(maxICost); } }
RelOptCost cost = mq.getNonCumulativeCost(rel); if (!costFactory.makeZeroCost().isLt(cost)) {
@Override public RelOptCost computeSelfCost(RelOptPlanner planner) { return RelMetadataQuery.getNonCumulativeCost(this); } }
/** * Model cost of join as size of Inputs. */ @Override public RelOptCost computeSelfCost(RelOptPlanner planner) { return RelMetadataQuery.getNonCumulativeCost(this); }
public RelOptCost getCumulativeCost(EnumerableInterpreter rel, RelMetadataQuery mq) { return mq.getNonCumulativeCost(rel); }
@Override public RelOptCost computeSelfCost(RelOptPlanner planner) { return RelMetadataQuery.getNonCumulativeCost(this); }
@Override public RelOptCost computeSelfCost(RelOptPlanner planner) { return RelMetadataQuery.getNonCumulativeCost(this); }
public RelOptCost getCumulativeCost(EnumerableInterpreter rel, RelMetadataQuery mq) { return mq.getNonCumulativeCost(rel); }
@Override public RelOptCost computeSelfCost(RelOptPlanner planner) { return RelMetadataQuery.getNonCumulativeCost(this); }
@Override public RelOptCost computeSelfCost(RelOptPlanner planner) { return RelMetadataQuery.getNonCumulativeCost(this); }
private double findCost(Prel prel, RelMetadataQuery mq) { DrillCostBase cost = (DrillCostBase) mq.getNonCumulativeCost(prel); double memory = cost.getMemory(); for (Prel child : prel) { memory += findCost(child, mq); } return memory; }
public RelOptCost getCumulativeCost(RelNode rel, RelMetadataQuery mq) { RelOptCost cost = mq.getNonCumulativeCost(rel); List<RelNode> inputs = rel.getInputs(); for (RelNode input : inputs) { cost = cost.plus(mq.getCumulativeCost(input)); } return cost; }
public RelOptCost getCumulativeCost(RelNode rel, RelMetadataQuery mq) { RelOptCost cost = mq.getNonCumulativeCost(rel); List<RelNode> inputs = rel.getInputs(); for (RelNode input : inputs) { cost = cost.plus(mq.getCumulativeCost(input)); } return cost; }
public RelOptCost getCumulativeCost(HiveJoin rel) { RelOptCost cost = RelMetadataQuery.getNonCumulativeCost(rel); List<RelNode> inputs = rel.getInputs(); RelOptCost maxICost = HiveCost.ZERO; for (RelNode input : inputs) { RelOptCost iCost = RelMetadataQuery.getCumulativeCost(input); if (maxICost.isLt(iCost)) { maxICost = iCost; } } return cost.plus(maxICost); } }
RelOptCost cost = p.getCluster().getMetadataQuery().getNonCumulativeCost(p); RelOptCost relCost = p.getCluster().getMetadataQuery().getNonCumulativeCost(p);
public RelOptCost getCost(RelNode rel, RelMetadataQuery mq) { assert rel != null : "pre-condition: rel != null"; if (rel instanceof RelSubset) { return ((RelSubset) rel).bestCost; } if (rel.getTraitSet().getTrait(ConventionTraitDef.INSTANCE) == Convention.NONE) { return costFactory.makeInfiniteCost(); } RelOptCost cost = mq.getNonCumulativeCost(rel); if (!zeroCost.isLt(cost)) { // cost must be positive, so nudge it cost = costFactory.makeTinyCost(); } for (RelNode input : rel.getInputs()) { cost = cost.plus(getCost(input, mq)); } return cost; }
public RelOptCost getCost(RelNode rel, RelMetadataQuery mq) { assert rel != null : "pre-condition: rel != null"; if (rel instanceof RelSubset) { return ((RelSubset) rel).bestCost; } if (rel.getTraitSet().getTrait(ConventionTraitDef.INSTANCE) == Convention.NONE) { return costFactory.makeInfiniteCost(); } RelOptCost cost = mq.getNonCumulativeCost(rel); if (!zeroCost.isLt(cost)) { // cost must be positive, so nudge it cost = costFactory.makeTinyCost(); } for (RelNode input : rel.getInputs()) { cost = cost.plus(getCost(input, mq)); } return cost; }