Re: [GENERAL] Are multiple array_aggs going to be in the same order? - Mailing list pgsql-general

From Tom Lane
Subject Re: [GENERAL] Are multiple array_aggs going to be in the same order?
Date
Msg-id 734.1491851980@sss.pgh.pa.us
Whole thread Raw
In response to Re: [GENERAL] Are multiple array_aggs going to be in the same order?  (Paul Jungwirth <pj@illuminatedcomputing.com>)
List pgsql-general
Paul Jungwirth <pj@illuminatedcomputing.com> writes:
> On 04/10/2017 11:35 AM, Tom Lane wrote:
>> I'm not very keen on recommending that the OP insert an ORDER BY into
>> each aggregate call, because that would cause a separate sort for each
>> aggregate (unless someone's improved that recently while I wasn't
>> looking).

> I mentioned this in my other email, upon a second look I was misreading
> the EXPLAIN output. (The sort was for the GROUP BY, not the individual
> ORDER BYs.) Do aggregate function sorts even show up in EXPLAIN?

They don't.  It's not a plannable behavior, just something that's
hard-wired into nodeAgg.c.  I'd like to see that improved someday,
but I don't think it's really high on anyone's priority list.

            regards, tom lane


pgsql-general by date:

Previous
From: Merlin Moncure
Date:
Subject: Re: [GENERAL] Are multiple array_aggs going to be in the same order?
Next
From: John Iliffe
Date:
Subject: Re: [GENERAL] Unable to connect to Postgresql