public RelOptCost minus(RelOptCost other) { if (this == INFINITY) { return this; } VolcanoCost that = (VolcanoCost) other; return new VolcanoCost( this.dRows - that.dRows, this.dCpu - that.dCpu, this.dIo - that.dIo); }
VolcanoCost( double dRows, double dCpu, double dIo) { set(dRows, dCpu, dIo); }
public double getRows() { if (best == null) { return VolcanoCost.INFINITY.getRows(); } else { return RelMetadataQuery.getRowCount(best); } }
public RelOptCost getCost(RelNode rel) { assert rel != null : "pre-condition: rel != null"; if (rel instanceof RelSubset) { return ((RelSubset) rel).bestCost; } if (rel.getTraitSet().getTrait(0) == Convention.NONE) { return makeInfiniteCost(); } RelOptCost cost = RelMetadataQuery.getNonCumulativeCost(rel); if (!VolcanoCost.ZERO.isLt(cost)) { // cost must be positive, so nudge it cost = makeTinyCost(); } for (RelNode input : rel.getInputs()) { cost = cost.plus(getCost(input)); } return cost; }
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); }
public RelOptCost plus(RelOptCost other) { VolcanoCost that = (VolcanoCost) other; if ((this == INFINITY) || (that == INFINITY)) { return INFINITY; } return new VolcanoCost( this.dRows + that.dRows, this.dCpu + that.dCpu, this.dIo + that.dIo); }
public RelOptCost multiplyBy(double factor) { if (this == INFINITY) { return this; } return new VolcanoCost(rowCount * factor, cpu * factor, io * factor); }
public RelOptCost makeCost( double dRows, double dCpu, double dIo) { return new VolcanoCost(dRows, dCpu, dIo); }
public RelOptCost plus(RelOptCost other) { VolcanoCost that = (VolcanoCost) other; if ((this == INFINITY) || (that == INFINITY)) { return INFINITY; } return new VolcanoCost( this.rowCount + that.rowCount, this.cpu + that.cpu, this.io + that.io); }
public RelOptCost multiplyBy(double factor) { if (this == INFINITY) { return this; } return new VolcanoCost(dRows * factor, dCpu * factor, dIo * factor); }
public RelOptCost makeCost(double dRows, double dCpu, double dIo) { return new VolcanoCost(dRows, dCpu, dIo); }