Re: Are multiple array_aggs going to be in the same order?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Paul Jungwirth <pj(at)illuminatedcomputing(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Are multiple array_aggs going to be in the same order?
Date: 2017-04-10 19:19:40
Message-ID: 734.1491851980@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Paul Jungwirth <pj(at)illuminatedcomputing(dot)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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message John Iliffe 2017-04-10 20:23:47 Re: Unable to connect to Postgresql
Previous Message Merlin Moncure 2017-04-10 19:13:22 Re: Are multiple array_aggs going to be in the same order?