Example #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);
  }
Example #2
0
    public OptiqPreparingStmt(
        CatalogReader catalogReader, RelDataTypeFactory typeFactory, Schema schema) {
      super(catalogReader);
      this.schema = schema;
      planner = new VolcanoPlanner();
      planner.addRelTraitDef(CallingConventionTraitDef.instance);
      RelOptUtil.registerAbstractRels(planner);
      planner.addRule(JavaRules.ENUMERABLE_JOIN_RULE);
      planner.addRule(JavaRules.ENUMERABLE_CALC_RULE);
      planner.addRule(JavaRules.ENUMERABLE_AGGREGATE_RULE);
      planner.addRule(JavaRules.ENUMERABLE_SORT_RULE);
      planner.addRule(JavaRules.ENUMERABLE_UNION_RULE);
      planner.addRule(JavaRules.ENUMERABLE_INTERSECT_RULE);
      planner.addRule(JavaRules.ENUMERABLE_MINUS_RULE);
      planner.addRule(TableAccessRule.instance);

      rexBuilder = new RexBuilder(typeFactory);
    }