@Override public RelOptCost computeSelfCost(RelOptPlanner planner, RelMetadataQuery mq) { return super.computeSelfCost(planner, mq).multiplyBy(.05); }
@Override public RelOptCost computeSelfCost(RelOptPlanner planner, RelMetadataQuery mq) { return super.computeSelfCost(planner, mq).multiplyBy(.05); }
@Override public RelOptCost computeSelfCost(RelOptPlanner planner, RelMetadataQuery mq) { final float f = projectRowType == null ? 1f : (float) projectRowType.getFieldCount() / 100f; return super.computeSelfCost(planner, mq).multiplyBy(.1 * f); }
@Override public RelOptCost computeSelfCost(RelOptPlanner planner, RelMetadataQuery mq) { // Cost factor for pushing filters double f = filters.isEmpty() ? 1d : 0.5d; // Cost factor for pushing fields // The "+ 2d" on top and bottom keeps the function fairly smooth. double p = ((double) projects.size() + 2d) / ((double) table.getRowType().getFieldCount() + 2d); // Multiply the cost by a factor that makes a scan more attractive if // filters and projects are pushed to the table scan return super.computeSelfCost(planner, mq) .multiplyBy(f * p * 0.01d); }
@Override public RelOptCost computeSelfCost(RelOptPlanner planner, RelMetadataQuery mq) { // Multiply the cost by a factor that makes a scan more attractive if it // has significantly fewer fields than the original scan. // // The "+ 2D" on top and bottom keeps the function fairly smooth. // // For example, if table has 3 fields, project has 1 field, // then factor = (1 + 2) / (3 + 2) = 0.6 return super.computeSelfCost(planner, mq) .multiplyBy(((double) fields.length + 2D) / ((double) table.getRowType().getFieldCount() + 2D)); }
@Override public RelOptCost computeSelfCost(RelOptPlanner planner, RelMetadataQuery mq) { // Cost factor for pushing filters double f = filters.isEmpty() ? 1d : 0.5d; // Cost factor for pushing fields // The "+ 2d" on top and bottom keeps the function fairly smooth. double p = ((double) projects.size() + 2d) / ((double) table.getRowType().getFieldCount() + 2d); // Multiply the cost by a factor that makes a scan more attractive if // filters and projects are pushed to the table scan return super.computeSelfCost(planner, mq) .multiplyBy(f * p * 0.01d); }
@Override public RelOptCost computeSelfCost(RelOptPlanner planner, RelMetadataQuery mq) { // Multiply the cost by a factor that makes a scan more attractive if it // has significantly fewer fields than the original scan. // // The "+ 2D" on top and bottom keeps the function fairly smooth. // // For example, if table has 3 fields, project has 1 field, // then factor = (1 + 2) / (3 + 2) = 0.6 return super.computeSelfCost(planner, mq) .multiplyBy(((double) fields.length + 2D) / ((double) table.getRowType().getFieldCount() + 2D)); }