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.

On Feb 17, 2019, at 8:29 AM, Jeff Janes <jeff.ja...@gmail.com> wrote:
> I don't think there is any way to assign an actual cost.  For example how do 
> you know if a buffer read was "actually" seq_page_cost or random_page_cost?  
> And if there were a way, it too would have a high variance.

Thanks for pointing that out! I think it's probably fine to use the same 
assumptions as the cost model? For example, we assume 3/4ths of accesses are 
sequential, 1/4th are not.

> What would I find very useful is a verbosity option to get the cost estimates 
> expressed as a multiplier of each *_cost parameter, rather than just as a 
> scalar.

Yeah, such expression would also help if we want to plug in the actual values.


On Feb 17, 2019, at 4:11 AM, Tomas Vondra <tomas.von...@2ndquadrant.com> wrote:
> Perhaps I'm just too used to comparing the rows/pages directly, but I
> don't quite see the benefit of having such "actual cost". Mostly because
> the cost model is rather rough anyway.

Yeah, I think the "actual cost" is only "actual" for the cost model - the cost 
it would output given the exact row/page number. Some articles/papers have 
shown row estimation is the primary reason for planners to go off, so showing 
the actual (or the updated assumption) might also be useful if people want to 
compare different plans and want to refer to a more accurate quantitative 
measure.

regards,
Donald Dong

Reply via email to