@Override public void addStreamedNestedLoopsCosts(EstimateProvider outerSide, EstimateProvider innerSide, long bufferSize, Costs costs, int costWeight) { long is = innerSide.getEstimatedOutputSize(); long oc = outerSide.getEstimatedNumRecords(); if (is > 0 && oc >= 0) { // costs, if the inner side cannot be cached if (is > bufferSize) { costs.addDiskCost(oc * is); } costs.addCpuCost((long) (oc * is * MATERIALIZATION_CPU_FACTOR)); } else { costs.setDiskCost(Costs.UNKNOWN); costs.setCpuCost(Costs.UNKNOWN); } // hack: assume 100k loops (should be expensive enough) costs.addHeuristicDiskCost(HEURISTIC_COST_BASE * 100000); costs.addHeuristicCpuCost((long) (HEURISTIC_COST_BASE * 100000 * MATERIALIZATION_CPU_FACTOR)); costs.multiplyWith(costWeight); }
@Override public void addStreamedNestedLoopsCosts(EstimateProvider outerSide, EstimateProvider innerSide, long bufferSize, Costs costs, int costWeight) { long is = innerSide.getEstimatedOutputSize(); long oc = outerSide.getEstimatedNumRecords(); if (is > 0 && oc >= 0) { // costs, if the inner side cannot be cached if (is > bufferSize) { costs.addDiskCost(oc * is); } costs.addCpuCost((long) (oc * is * MATERIALIZATION_CPU_FACTOR)); } else { costs.setDiskCost(Costs.UNKNOWN); costs.setCpuCost(Costs.UNKNOWN); } // hack: assume 100k loops (should be expensive enough) costs.addHeuristicDiskCost(HEURISTIC_COST_BASE * 100000); costs.addHeuristicCpuCost((long) (HEURISTIC_COST_BASE * 100000 * MATERIALIZATION_CPU_FACTOR)); costs.multiplyWith(costWeight); }
@Override public void addStreamedNestedLoopsCosts(EstimateProvider outerSide, EstimateProvider innerSide, long bufferSize, Costs costs, int costWeight) { long is = innerSide.getEstimatedOutputSize(); long oc = outerSide.getEstimatedNumRecords(); if (is > 0 && oc >= 0) { // costs, if the inner side cannot be cached if (is > bufferSize) { costs.addDiskCost(oc * is); } costs.addCpuCost((long) (oc * is * MATERIALIZATION_CPU_FACTOR)); } else { costs.setDiskCost(Costs.UNKNOWN); costs.setCpuCost(Costs.UNKNOWN); } // hack: assume 100k loops (should be expensive enough) costs.addHeuristicDiskCost(HEURISTIC_COST_BASE * 100000); costs.addHeuristicCpuCost((long) (HEURISTIC_COST_BASE * 100000 * MATERIALIZATION_CPU_FACTOR)); costs.multiplyWith(costWeight); }
@Override public void addStreamedNestedLoopsCosts(EstimateProvider outerSide, EstimateProvider innerSide, long bufferSize, Costs costs, int costWeight) { long is = innerSide.getEstimatedOutputSize(); long oc = outerSide.getEstimatedNumRecords(); if (is > 0 && oc >= 0) { // costs, if the inner side cannot be cached if (is > bufferSize) { costs.addDiskCost(oc * is); } costs.addCpuCost((long) (oc * is * MATERIALIZATION_CPU_FACTOR)); } else { costs.setDiskCost(Costs.UNKNOWN); costs.setCpuCost(Costs.UNKNOWN); } // hack: assume 100k loops (should be expensive enough) costs.addHeuristicDiskCost(HEURISTIC_COST_BASE * 100000); costs.addHeuristicCpuCost((long) (HEURISTIC_COST_BASE * 100000 * MATERIALIZATION_CPU_FACTOR)); costs.multiplyWith(costWeight); }
@Override public void addStreamedNestedLoopsCosts(EstimateProvider outerSide, EstimateProvider innerSide, long bufferSize, Costs costs, int costWeight) { long is = innerSide.getEstimatedOutputSize(); long oc = outerSide.getEstimatedNumRecords(); if (is > 0 && oc >= 0) { // costs, if the inner side cannot be cached if (is > bufferSize) { costs.addDiskCost(oc * is); } costs.addCpuCost((long) (oc * is * MATERIALIZATION_CPU_FACTOR)); } else { costs.setDiskCost(Costs.UNKNOWN); costs.setCpuCost(Costs.UNKNOWN); } // hack: assume 100k loops (should be expensive enough) costs.addHeuristicDiskCost(HEURISTIC_COST_BASE * 100000); costs.addHeuristicCpuCost((long) (HEURISTIC_COST_BASE * 100000 * MATERIALIZATION_CPU_FACTOR)); costs.multiplyWith(costWeight); }