public Cost findLocalCost(ICatalog catalog, LogicalProperty[] inputLogProp) {
    // XXX vpapad: really naive. Only considers the hashing cost
    float inpCard = inputLogProp[0].getCardinality();
    float outputCard = logProp.getCardinality();

    double cost = inpCard * catalog.getDouble("tuple_reading_cost");
    cost += inpCard * catalog.getDouble("tuple_hashing_cost");
    cost += outputCard * catalog.getDouble("tuple_construction_cost");
    return new Cost(cost);
  }
コード例 #2
0
 /**
  * @see niagara.optimizer.colombia.PhysicalOp#FindLocalCost(ICatalog, LogicalProperty,
  *     LogicalProperty[])
  */
 public Cost findLocalCost(ICatalog catalog, LogicalProperty[] InputLogProp) {
   // XXX vpapad: totally bogus flat cost for stream scans
   return new Cost(catalog.getDouble("stream_scan_cost"));
 }