On Feb 17, 2019, at 11:05 AM, Donald Dong <xd...@csumb.edu> wrote: > > On Feb 17, 2019, at 10:56 AM, Tom Lane <t...@sss.pgh.pa.us> wrote: >> Perhaps, but refactoring to get that seems impractically invasive & >> expensive, since e.g. index AM cost estimate functions would have to >> be redefined, plus we'd have to carry around some kind of cost vector >> rather than single numbers for every Path ... > > Maybe we could walk through the final plan tree and fill the expression? With > another tree structure to hold the cost vectors.
Here is a draft patch. I added a new structure called CostInfo to the Plan node. The CostInfo is be added in create_plan, and the cost calculation is centered at CostInfo. Is this a reasonable approach? Thank you, Donald Dong
01_actual_cost_seqscan_001.patch
Description: Binary data