@Override public void addBlockNestedLoopsCosts(EstimateProvider outerSide, EstimateProvider innerSide, long blockSize, Costs costs, int costWeight) { long is = innerSide.getEstimatedOutputSize(); long os = outerSide.getEstimatedOutputSize(); if (is > 0 && os > 0) { long loops = Math.max(os / blockSize, 1); costs.addDiskCost(loops * is); costs.addCpuCost((long) (loops * is * MATERIALIZATION_CPU_FACTOR)); } else { costs.setDiskCost(Costs.UNKNOWN); costs.setCpuCost(Costs.UNKNOWN); } // hack: assume 1k loops (much cheaper than the streamed variant!) costs.addHeuristicDiskCost(HEURISTIC_COST_BASE * 1000); costs.addHeuristicCpuCost((long) (HEURISTIC_COST_BASE * 1000 * MATERIALIZATION_CPU_FACTOR)); costs.multiplyWith(costWeight); }
@Override public void addHybridHashCosts(EstimateProvider buildSideInput, EstimateProvider probeSideInput, Costs costs, int costWeight) { long bs = buildSideInput.getEstimatedOutputSize(); long ps = probeSideInput.getEstimatedOutputSize(); if (bs > 0 && ps > 0) { long overall = 2*bs + ps; costs.addDiskCost(overall); costs.addCpuCost((long) (overall * HASHING_CPU_FACTOR)); } else { costs.setDiskCost(Costs.UNKNOWN); costs.setCpuCost(Costs.UNKNOWN); } costs.addHeuristicDiskCost(2 * HEURISTIC_COST_BASE); costs.addHeuristicCpuCost((long) (2 * HEURISTIC_COST_BASE * HASHING_CPU_FACTOR)); // cost weight applies to everything 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); }
costs.multiplyWith(channel.getCostWeight());
mm5.multiplyWith(5); costEstimator.addLocalMergeCost(e1, e2, mm5, 5);
@Override public void addBlockNestedLoopsCosts(EstimateProvider outerSide, EstimateProvider innerSide, long blockSize, Costs costs, int costWeight) { long is = innerSide.getEstimatedOutputSize(); long os = outerSide.getEstimatedOutputSize(); if (is > 0 && os > 0) { long loops = Math.max(os / blockSize, 1); costs.addDiskCost(loops * is); costs.addCpuCost((long) (loops * is * MATERIALIZATION_CPU_FACTOR)); } else { costs.setDiskCost(Costs.UNKNOWN); costs.setCpuCost(Costs.UNKNOWN); } // hack: assume 1k loops (much cheaper than the streamed variant!) costs.addHeuristicDiskCost(HEURISTIC_COST_BASE * 1000); costs.addHeuristicCpuCost((long) (HEURISTIC_COST_BASE * 1000 * MATERIALIZATION_CPU_FACTOR)); costs.multiplyWith(costWeight); }
@Override public void addBlockNestedLoopsCosts(EstimateProvider outerSide, EstimateProvider innerSide, long blockSize, Costs costs, int costWeight) { long is = innerSide.getEstimatedOutputSize(); long os = outerSide.getEstimatedOutputSize(); if (is > 0 && os > 0) { long loops = Math.max(os / blockSize, 1); costs.addDiskCost(loops * is); costs.addCpuCost((long) (loops * is * MATERIALIZATION_CPU_FACTOR)); } else { costs.setDiskCost(Costs.UNKNOWN); costs.setCpuCost(Costs.UNKNOWN); } // hack: assume 1k loops (much cheaper than the streamed variant!) costs.addHeuristicDiskCost(HEURISTIC_COST_BASE * 1000); costs.addHeuristicCpuCost((long) (HEURISTIC_COST_BASE * 1000 * MATERIALIZATION_CPU_FACTOR)); costs.multiplyWith(costWeight); }
@Override public void addBlockNestedLoopsCosts(EstimateProvider outerSide, EstimateProvider innerSide, long blockSize, Costs costs, int costWeight) { long is = innerSide.getEstimatedOutputSize(); long os = outerSide.getEstimatedOutputSize(); if (is > 0 && os > 0) { long loops = Math.max(os / blockSize, 1); costs.addDiskCost(loops * is); costs.addCpuCost((long) (loops * is * MATERIALIZATION_CPU_FACTOR)); } else { costs.setDiskCost(Costs.UNKNOWN); costs.setCpuCost(Costs.UNKNOWN); } // hack: assume 1k loops (much cheaper than the streamed variant!) costs.addHeuristicDiskCost(HEURISTIC_COST_BASE * 1000); costs.addHeuristicCpuCost((long) (HEURISTIC_COST_BASE * 1000 * MATERIALIZATION_CPU_FACTOR)); costs.multiplyWith(costWeight); }
@Override public void addBlockNestedLoopsCosts(EstimateProvider outerSide, EstimateProvider innerSide, long blockSize, Costs costs, int costWeight) { long is = innerSide.getEstimatedOutputSize(); long os = outerSide.getEstimatedOutputSize(); if (is > 0 && os > 0) { long loops = Math.max(os / blockSize, 1); costs.addDiskCost(loops * is); costs.addCpuCost((long) (loops * is * MATERIALIZATION_CPU_FACTOR)); } else { costs.setDiskCost(Costs.UNKNOWN); costs.setCpuCost(Costs.UNKNOWN); } // hack: assume 1k loops (much cheaper than the streamed variant!) costs.addHeuristicDiskCost(HEURISTIC_COST_BASE * 1000); costs.addHeuristicCpuCost((long) (HEURISTIC_COST_BASE * 1000 * MATERIALIZATION_CPU_FACTOR)); costs.multiplyWith(costWeight); }
@Override public void addHybridHashCosts(EstimateProvider buildSideInput, EstimateProvider probeSideInput, Costs costs, int costWeight) { long bs = buildSideInput.getEstimatedOutputSize(); long ps = probeSideInput.getEstimatedOutputSize(); if (bs > 0 && ps > 0) { long overall = 2*bs + ps; costs.addDiskCost(overall); costs.addCpuCost((long) (overall * HASHING_CPU_FACTOR)); } else { costs.setDiskCost(Costs.UNKNOWN); costs.setCpuCost(Costs.UNKNOWN); } costs.addHeuristicDiskCost(2 * HEURISTIC_COST_BASE); costs.addHeuristicCpuCost((long) (2 * HEURISTIC_COST_BASE * HASHING_CPU_FACTOR)); // cost weight applies to everything costs.multiplyWith(costWeight); }
@Override public void addHybridHashCosts(EstimateProvider buildSideInput, EstimateProvider probeSideInput, Costs costs, int costWeight) { long bs = buildSideInput.getEstimatedOutputSize(); long ps = probeSideInput.getEstimatedOutputSize(); if (bs > 0 && ps > 0) { long overall = 2*bs + ps; costs.addDiskCost(overall); costs.addCpuCost((long) (overall * HASHING_CPU_FACTOR)); } else { costs.setDiskCost(Costs.UNKNOWN); costs.setCpuCost(Costs.UNKNOWN); } costs.addHeuristicDiskCost(2 * HEURISTIC_COST_BASE); costs.addHeuristicCpuCost((long) (2 * HEURISTIC_COST_BASE * HASHING_CPU_FACTOR)); // cost weight applies to everything 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 addHybridHashCosts(EstimateProvider buildSideInput, EstimateProvider probeSideInput, Costs costs, int costWeight) { long bs = buildSideInput.getEstimatedOutputSize(); long ps = probeSideInput.getEstimatedOutputSize(); if (bs > 0 && ps > 0) { long overall = 2*bs + ps; costs.addDiskCost(overall); costs.addCpuCost((long) (overall * HASHING_CPU_FACTOR)); } else { costs.setDiskCost(Costs.UNKNOWN); costs.setCpuCost(Costs.UNKNOWN); } costs.addHeuristicDiskCost(2 * HEURISTIC_COST_BASE); costs.addHeuristicCpuCost((long) (2 * HEURISTIC_COST_BASE * HASHING_CPU_FACTOR)); // cost weight applies to everything costs.multiplyWith(costWeight); }
@Override public void addHybridHashCosts(EstimateProvider buildSideInput, EstimateProvider probeSideInput, Costs costs, int costWeight) { long bs = buildSideInput.getEstimatedOutputSize(); long ps = probeSideInput.getEstimatedOutputSize(); if (bs > 0 && ps > 0) { long overall = 2*bs + ps; costs.addDiskCost(overall); costs.addCpuCost((long) (overall * HASHING_CPU_FACTOR)); } else { costs.setDiskCost(Costs.UNKNOWN); costs.setCpuCost(Costs.UNKNOWN); } costs.addHeuristicDiskCost(2 * HEURISTIC_COST_BASE); costs.addHeuristicCpuCost((long) (2 * HEURISTIC_COST_BASE * HASHING_CPU_FACTOR)); // cost weight applies to everything 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); }
costs.multiplyWith(channel.getCostWeight());
costs.multiplyWith(channel.getCostWeight());
costs.multiplyWith(channel.getCostWeight());