Re: Parallel Aggregate

From: Haribabu Kommi <kommi(dot)haribabu(at)gmail(dot)com>
To: David Rowley <david(dot)rowley(at)2ndquadrant(dot)com>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Parallel Aggregate
Date: 2015-12-12 13:28:18
Message-ID: CAJrrPGcASk5QCq0CAtyHn+MYhxNxusFC3kh1bZkn47fgmmSKyA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sat, Dec 12, 2015 at 8:42 AM, David Rowley
<david(dot)rowley(at)2ndquadrant(dot)com> wrote:
> On 12 December 2015 at 04:00, Robert Haas <robertmhaas(at)gmail(dot)com> wrote:
>>
>> I'd like to commit David Rowley's patch from the other thread first,
>> and then deal with this one afterwards. The only thing I feel
>> strongly needs to be changed in that patch is CFUNC -> COMBINEFUNC,
>> for clarity.
>
>
> I have addressed that in my local copy. I'm now just working on adding some
> test code which uses the new infrastructure. Perhaps I'll just experiment
> with the parallel aggregate stuff instead now.
>

Here I attached a patch with following changes, i feel it is better to
include them as part
of combine aggregate patch.

1. Added Missing outfuncs.c changes for newly added variables in
Aggref structure
2. Keeping the aggregate function in final aggregate stage to do the
final aggregate
on the received tuples from all workers.

Patch still needs a fix for correcting the explain plan output issue.

postgres=# explain analyze verbose select count(*), sum(f1) from tbl
where f1 % 100 = 0 group by f3;
QUERY
PLAN
----------------------------------------------------------------------------------------------------------------------------------------
Finalize HashAggregate (cost=1853.75..1853.76 rows=1 width=12)
(actual time=92.428..92.429 rows=1 loops=1)
Output: pg_catalog.count(*), pg_catalog.sum((sum(f1))), f3
Group Key: tbl.f3
-> Gather (cost=0.00..1850.00 rows=500 width=12) (actual
time=92.408..92.416 rows=3 loops=1)
Output: f3, (count(*)), (sum(f1))

Regards,
Hari Babu
Fujitsu Australia

Attachment Content-Type Size
set_ref_final_agg.patch application/octet-stream 7.6 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2015-12-12 13:31:30 Re: Error with index on unlogged table
Previous Message Amit Kapila 2015-12-12 13:03:10 Re: Speed up Clog Access by increasing CLOG buffers