Re: WIP Patch for GROUPING SETS phase 1 - Mailing list pgsql-hackers

From Robert Haas
Subject Re: WIP Patch for GROUPING SETS phase 1
Date
Msg-id CA+TgmoYnKMik3uBLibfFzNUBEyT-Ws-i5gzO5yBNzWpAARP85Q@mail.gmail.com
Whole thread Raw
In response to Re: WIP Patch for GROUPING SETS phase 1  (Pavel Stehule <pavel.stehule@gmail.com>)
Responses Re: WIP Patch for GROUPING SETS phase 1
List pgsql-hackers
On Tue, Sep 9, 2014 at 11:19 AM, Pavel Stehule <pavel.stehule@gmail.com> wrote:
> 2014-09-09 16:01 GMT+02:00 Robert Haas <robertmhaas@gmail.com>:
>> On Thu, Aug 21, 2014 at 11:01 AM, Andrew Gierth
>> <andrew@tao11.riddles.org.uk> wrote:
>> >>>>>> "Heikki" == Heikki Linnakangas <hlinnakangas@vmware.com> writes:
>> >  Heikki> Uh, that's ugly. The EXPLAIN out I mean; as an implementation
>> >  Heikki> detail chaining the nodes might be reasonable. But the above
>> >  Heikki> gets unreadable if you have more than a few grouping sets.
>> >
>> > It's good for highlighting performance issues in EXPLAIN, too.
>>
>> Perhaps so, but that doesn't take away from Heikki's point: it's still
>> ugly.  I don't understand why the sorts can't all be nested under the
>> GroupAggregate nodes.  We have a number of nodes already (e.g. Append)
>> that support an arbitrary number of children, and I don't see why we
>> can't do the same thing here.
>
> I don't think so showing sort and aggregation is bad idea. Both can have a
> different performance impacts

Sure, showing the sort and aggregation steps is fine.  But I don't see
what advantage we get out of showing them like this:

Aggregate
-> Sort -> ChainAggregate   -> Sort     -> ChainAggregate        -> Sort

When we could show them like this:

Aggregate
-> Sort
-> Sort
-> Sort

From both a display perspective and an implementation-complexity
perspective, it seems appealing to have the Aggregate node feed the
data to one sort after another, rather having it send the data down a
very deep pipe.

I might be missing something, of course.  I don't want to presume that
I'm smarter than Andrew, because Andrew is pretty smart.  :-)  But it
seems odd to me.

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



pgsql-hackers by date:

Previous
From: Pavel Stehule
Date:
Subject: Re: WIP Patch for GROUPING SETS phase 1
Next
From: Bianca Santana Espichicoquez
Date:
Subject: Problems with config.php and non default ports (postgresql - sugarcrm)