Re: Parallel grouping sets - Mailing list pgsql-hackers

From Pengzhou Tang
Subject Re: Parallel grouping sets
Date
Msg-id CAG4reAQRbuLd_fhjyhjHSXFDSeBmCO=rrDM53O8v04dR071uaQ@mail.gmail.com
Whole thread Raw
In response to Re: Parallel grouping sets  (Tomas Vondra <tomas.vondra@2ndquadrant.com>)
Responses Re: Parallel grouping sets  (Tomas Vondra <tomas.vondra@2ndquadrant.com>)
List pgsql-hackers
Hi Tomas,

I rebased the code and resolved the comments you attached, some unresolved
comments are explained in 0002-fixes.patch, please take a look.

I also make the hash spill working for parallel grouping sets, the plan looks like:

gpadmin=# explain select g100, g10, sum(g::numeric), count(*), max(g::text)
from gstest_p group by cube (g100,g10);
                                        QUERY PLAN
-------------------------------------------------------------------------------------------
 Finalize MixedAggregate  (cost=1000.00..7639.95 rows=1111 width=80)
   Filtered by: (GROUPINGSETID())
   Group Key: ()
   Hash Key: g100, g10
   Hash Key: g100
   Hash Key: g10
   Planned Partitions: 4
   ->  Gather  (cost=1000.00..6554.34 rows=7777 width=84)
         Workers Planned: 7
         ->  Partial MixedAggregate  (cost=0.00..4776.64 rows=1111 width=84)
               Group Key: ()
               Hash Key: g100, g10
               Hash Key: g100
               Hash Key: g10
               Planned Partitions: 4
               ->  Parallel Seq Scan on gstest_p  (cost=0.00..1367.71 rows=28571 width=12)
(16 rows)

Thanks,
Pengzhou

On Thu, Mar 19, 2020 at 10:09 AM Tomas Vondra <tomas.vondra@2ndquadrant.com> wrote:
Hi,

unfortunately this got a bit broken by the disk-based hash aggregation,
committed today, and so it needs a rebase. I've started looking at the
patch before that, and I have it rebased on e00912e11a9e (i.e. the
commit before the one that breaks it).

Attached is the rebased patch series (now broken), with a couple of
commits with some minor cosmetic changes I propose to make (easier than
explaining it on a list, it's mostly about whitespace, comments etc).
Feel free to reject the changes, it's up to you.

I'll continue doing the review, but it'd be good to have a fully rebased
version.

regards

--
Tomas Vondra                  https://urldefense.proofpoint.com/v2/url?u=http-3A__www.2ndQuadrant.com&d=DwIBAg&c=lnl9vOaLMzsy2niBC8-h_K-7QJuNJEsFrzdndhuJ3Sw&r=L968W84_Yb9HJKtAAZUSYw&m=hYswOh9Appfj1CipZAY8-RyPSLWnua0VLEaMDCJ2L3s&s=iYybgoMynB_mcwDfPDmJv3afu-Xdis45lMkS-_6LGnQ&e=
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
Attachment

pgsql-hackers by date:

Previous
From: Magnus Hagander
Date:
Subject: Re: Why does [auto-]vacuum delay not report a wait event?
Next
From: Laurenz Albe
Date:
Subject: Re: Berserk Autovacuum (let's save next Mandrill)