Exemple #1
0
  // implement RelNode
  public RelOptCost computeSelfCost(RelOptPlanner planner) {
    double dRows = RelMetadataQuery.getRowCount(this);

    // Assume CPU is negligible since values are precomputed.
    double dCpu = 1;
    double dIo = 0;
    return planner.makeCost(dRows, dCpu, dIo);
  }
Exemple #2
0
 public RelTraitSet traitSetOf(RelTrait... traits) {
   RelTraitSet traitSet = emptyTraitSet;
   assert traitSet.size() == planner.getRelTraitDefs().size();
   for (RelTrait trait : traits) {
     traitSet = traitSet.replace(trait);
   }
   return traitSet;
 }
Exemple #3
0
  /** Creates a cluster. */
  RelOptCluster(
      RelOptQuery query,
      RelOptPlanner planner,
      RelDataTypeFactory typeFactory,
      RexBuilder rexBuilder) {
    assert planner != null;
    assert typeFactory != null;
    this.query = query;
    this.planner = planner;
    this.typeFactory = typeFactory;
    this.rexBuilder = rexBuilder;
    this.originalExpression = rexBuilder.makeLiteral("?");

    // set up a default rel metadata provider,
    // giving the planner first crack at everything
    metadataProvider = new DefaultRelMetadataProvider();
    this.emptyTraitSet = planner.emptyTraitSet();
  }
Exemple #4
0
 public RelOptCost computeSelfCost(RelOptPlanner planner) {
   double dRows = RelMetadataQuery.getRowCount(this);
   double dCpu = RelMetadataQuery.getRowCount(getChild()) * program.getExprCount();
   double dIo = 0;
   return planner.makeCost(dRows, dCpu, dIo);
 }