estimate_costs(PlannerInfo *root, RelOptInfo *baserel, Cost *startup_cost, Cost *total_cost)
{
RangeTblEntry *rte;
- int width;
double connection_cost = 0.0;
double transfer_cost = 0.0;
elog(DEBUG3, "%s() called", __FUNCTION__);
- /*
- * Use cost_seqscan() to get approximate value.
- */
+ /* get avarage width estimation */
rte = planner_rt_fetch(baserel->relid, root);
-// cost_seqscan(&path->path, root, baserel);
-
- width = get_relation_data_width(rte->relid, NULL);
+ baserel->width = get_relation_data_width(rte->relid, baserel->attr_widths);
/* XXX arbitrary guesses */
connection_cost = 10.0;
transfer_cost = 1.0;
*startup_cost += connection_cost;
*total_cost += connection_cost;
- *total_cost += transfer_cost * width * baserel->tuples;
+ *total_cost += transfer_cost * baserel->width * baserel->tuples;
}
/* ============================================================================