Re: Actual Cost

From: Donald Dong <xdong(at)csumb(dot)edu>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Tomas Vondra <tomas(dot)vondra(at)2ndquadrant(dot)com>, David Fetter <david(at)fetter(dot)org>, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Actual Cost
Date: 2019-02-17 06:45:13
Message-ID: 61B324CE-CCBA-4F77-A506-92E08543BB69@csumb.edu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Feb 16, 2019, at 9:31 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>
> Donald Dong <xdong(at)csumb(dot)edu> 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 rows=34 width=32) (actual cost=3.92..18500 time=209.820..1168.831 rows=47 loops=3)
>
>> Now we have the actual time. Time can have a high variance (a change
>> in system load, or just noises), but I think the actual cost would be
>> less likely to change due to external factors.
>
> I'm with Tomas: you have not explained what you think those
> numbers mean.

Yeah, I was considering the actual cost to be the output of the cost
model given the actual rows and pages after we instrument the
execution: plug in the values which are no longer estimations.

For a hash join, we could use the actual inner_rows_total to get the
actual cost. For a seqscan, we can use the actual rows to get the
actual CPU cost.

regards,
Donald Dong

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Ramanarayana 2019-02-17 07:15:39 Re: BUG #15548: Unaccent does not remove combining diacritical characters
Previous Message Tom Lane 2019-02-17 05:31:33 Re: Actual Cost