Re: Actual Cost

2019-02-17 Thread Donald Dong
On Feb 17, 2019, at 11:05 AM, Donald Dong wrote: > > On Feb 17, 2019, at 10:56 AM, Tom Lane 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 k

Re: Actual Cost

2019-02-17 Thread Justin Pryzby
On Sun, Feb 17, 2019 at 11:29:56AM -0500, Jeff Janes wrote: > What would I find very useful is [...] an rusage report rather than just > wall-clock duration. Most of that's available; [pryzbyj@database ~]$ psql postgres -xtc "SET client_min_messages=log; SET log_statement_stats=on" -c 'SELECT ma

Re: Actual Cost

2019-02-17 Thread Donald Dong
gle 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 wrote: > I don't think there is any way to assign an actual cost. For example how do &g

Re: Actual Cost

2019-02-17 Thread Tom Lane
Jeff Janes writes: > 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. Perhaps, but refactoring to get that seems impractically invasive & expensive, since e.g. index AM cost estimate

Re: Actual Cost

2019-02-17 Thread Jeff Janes
o have. How large an effort would you guess it would be > >> to build a proof of concept? > > > > I don't quite understand what is meant by "actual cost metric" and/or > > how is that different from running EXPLAIN ANALYZE. > > Here is an example

Re: Actual Cost

2019-02-17 Thread Tomas Vondra
On 2/17/19 7:45 AM, Donald Dong wrote: > On Feb 16, 2019, at 9:31 PM, Tom Lane wrote: >> >> Donald Dong writes: >>> On Feb 16, 2019, at 6:44 PM, Tomas Vondra wrote: >>>> I don't quite understand what is meant by "actual cost metric" and/or >

Re: Actual Cost

2019-02-16 Thread Donald Dong
On Feb 16, 2019, at 9:31 PM, Tom Lane wrote: > > Donald Dong writes: >> On Feb 16, 2019, at 6:44 PM, Tomas Vondra wrote: >>> I don't quite understand what is meant by "actual cost metric" and/or >>> how is that different from running EXPLAIN ANALY

Re: Actual Cost

2019-02-16 Thread Tom Lane
Donald Dong writes: > On Feb 16, 2019, at 6:44 PM, Tomas Vondra wrote: >> I don't quite understand what is meant by "actual cost metric" and/or >> how is that different from running EXPLAIN ANALYZE. > Here is an example: > Hash Join (cost=3.92..18545.70

Re: Actual Cost

2019-02-16 Thread Donald Dong
roof of concept? > > I don't quite understand what is meant by "actual cost metric" and/or > how is that different from running EXPLAIN ANALYZE. Here is an example: Hash Join (cost=3.92..18545.70 rows=34 width=32) (actual cost=3.92..18500 time=209.820..1168.831 rows=47

Re: Actual Cost

2019-02-16 Thread Tomas Vondra
On 2/17/19 3:40 AM, David Fetter wrote: > On Sat, Feb 16, 2019 at 03:10:44PM -0800, Donald Dong wrote: >> Hi, >> >> When explaining a query, I think knowing the actual rows and pages >> in addition to the operation type (e.g seqscan) would be enough to >> calc

Re: Actual Cost

2019-02-16 Thread David Fetter
On Sat, Feb 16, 2019 at 03:10:44PM -0800, Donald Dong wrote: > Hi, > > When explaining a query, I think knowing the actual rows and pages > in addition to the operation type (e.g seqscan) would be enough to > calculate the actual cost. The actual cost metric could be useful &g

Actual Cost

2019-02-16 Thread Donald Dong
Hi, When explaining a query, I think knowing the actual rows and pages in addition to the operation type (e.g seqscan) would be enough to calculate the actual cost. The actual cost metric could be useful when we want to look into how off is the planner's estimation, and the correlation be