Re: FILTER for aggregates [was Re: Department of Redundancy Department: makeNode(FuncCall) division] - Mailing list pgsql-hackers

From Andrew Gierth
Subject Re: FILTER for aggregates [was Re: Department of Redundancy Department: makeNode(FuncCall) division]
Date
Msg-id 1430cb03838fb80e461b72461789ef74@news-out.riddles.org.uk
Whole thread Raw
In response to Re: FILTER for aggregates [was Re: Department of Redundancy Department: makeNode(FuncCall) division]  (Dean Rasheed <dean.a.rasheed@gmail.com>)
Responses Re: FILTER for aggregates [was Re: Department of Redundancy Department: makeNode(FuncCall) division]
List 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)



pgsql-hackers by date:

Previous
From: Nicholas White
Date:
Subject: Re: Request for Patch Feedback: Lag & Lead Window Functions Can Ignore Nulls
Next
From: Fabien COELHO
Date:
Subject: Re: [PATCH] pgbench --throttle (submission 7 - with lag measurement)