Re: EXPLAIN VERBOSE with parallel Aggregate

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: David Rowley <david(dot)rowley(at)2ndquadrant(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: EXPLAIN VERBOSE with parallel Aggregate
Date: 2016-04-27 00:37:28
Message-ID: CA+Tgmoa-kSOJCpGytt8TWmUi2f=HBJhK_QNbPL1Ev7H=07AZ8A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Apr 26, 2016 at 6:44 PM, David Rowley
<david(dot)rowley(at)2ndquadrant(dot)com> wrote:
> On 27 April 2016 at 08:46, Robert Haas <robertmhaas(at)gmail(dot)com> wrote:
>> My proposed fix for this issue is attached. Review is welcome;
>> otherwise, I'll just commit this. The output looks like what I
>> suggested upthread:
>
> + if (!aggref->aggpartial)
> + elog(ERROR, "referenced Aggref is not partial");
>
> I think this is overly restrictive; ruleutils seems a bit out of line
> here to say that plans can't have > 1 combine aggregate node.
>
> When coding the combine aggs stuff I had test code to inject
> additional combine paths to make sure everything worked as expected.
> It did, but it won't if you add these two lines. I'd say just remove
> them.
>
> If you apply the attached and execute;
>
> create table t1 (num int not null);
> insert into t1 select generate_series(1,2000000);
>
> explain verbose select avg(num) from t1;
>
> You'll get;
>
> ERROR: referenced Aggref is not partial

In this test patch, should aggpath be using partial_grouping_target
rather than target? I feel like we need to use
partial_grouping_target unless finalizeAggs is true.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2016-04-27 00:45:01 Re: pgsql: pg_upgrade: Convert old visibility map format to new format.
Previous Message Robert Haas 2016-04-27 00:32:56 Re: Removing faulty hyperLogLog merge function