Re: FILTER for aggregates [was Re: Department of Redundancy Department: makeNode(FuncCall) division]

From: Andrew Gierth <andrew(at)tao11(dot)riddles(dot)org(dot)uk>
To: Noah Misch <noah(at)leadboat(dot)com>, David Fetter <david(at)fetter(dot)org>, PG Hackers <pgsql-hackers(at)postgresql(dot)org>
Cc: Dean Rasheed <dean(dot)a(dot)rasheed(at)gmail(dot)com>
Subject: Re: FILTER for aggregates [was Re: Department of Redundancy Department: makeNode(FuncCall) division]
Date: 2013-07-15 18:56:17
Message-ID: 1430cb03838fb80e461b72461789ef74@news-out.riddles.org.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Noah Misch said:

> I twitched upon reading this, because neither ORDER BY nor FILTER preclude
> the aggregate being MIN or MAX. Perhaps Andrew can explain why he put
> aggorder there back in 2009.

The bottom line is that I intentionally avoided assuming that an agg with an
aggsortop could only be min() or max() and that having an order by clause
would always be harmless in such cases. I can't think of an actual use case
where it would matter, but I've seen people define some pretty strange aggs
recently.

So I mildly object to simply throwing away the ORDER BY clause in such cases.

--
Andrew (irc:RhodiumToad)

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Fabien COELHO 2013-07-15 19:02:36 Re: [PATCH] pgbench --throttle (submission 7 - with lag measurement)
Previous Message Nicholas White 2013-07-15 18:45:10 Re: Request for Patch Feedback: Lag & Lead Window Functions Can Ignore Nulls