Re: [HACKERS] AGG_HASHED cost estimate - Mailing list pgsql-hackers

From Dilip Kumar
Subject Re: [HACKERS] AGG_HASHED cost estimate
Date
Msg-id CAFiTN-v6GEJpKsmacchnSYUzGzYqhobTRhg5jEqJY86YnbnKFg@mail.gmail.com
Whole thread Raw
In response to Re: [HACKERS] AGG_HASHED cost estimate  (Ashutosh Bapat <ashutosh.bapat@enterprisedb.com>)
List pgsql-hackers
On Thu, Apr 20, 2017 at 4:16 PM, Ashutosh Bapat
<ashutosh.bapat@enterprisedb.com> wrote:
> but cost this without numGroups.
>
>     /*
>      * The transCost.per_tuple component of aggcosts should be charged once
>      * per input tuple, corresponding to the costs of evaluating the aggregate
>      * transfns and their input expressions (with any startup cost of course
>      * charged but once).  The finalCost component is charged once per output
>      * tuple, corresponding to the costs of evaluating the finalfns.
>      *
>      * If we are grouping, we charge an additional cpu_operator_cost per
>      * grouping column per input tuple for grouping comparisons.
>      *
>
> The reason may be that hashing isn't as costly as a comparison. I
> don't how true is that.

Earlier in GatherMerge thread[1], Rushabh mentioned that hashAggregate
is getting picked where actually grouping aggregate with GatherMerge
was faster during actual execution time and he suspected problems with
costing of hashAggregate. Maybe this is one of those?

[1]https://www.postgresql.org/message-id/CAGPqQf2164iV6k-_M75qEZWiCfRarA_SKSmHjc0Uh1rEf5RJrA%40mail.gmail.com


-- 
Regards,
Dilip Kumar
EnterpriseDB: http://www.enterprisedb.com



pgsql-hackers by date:

Previous
From: Petr Jelinek
Date:
Subject: Re: [HACKERS] snapbuild woes
Next
From: Petr Jelinek
Date:
Subject: Re: [HACKERS] Interval for launching the table sync worker