Re: Parsing of aggregate ORDER BY clauses - Mailing list pgsql-hackers

From Robert Haas
Subject Re: Parsing of aggregate ORDER BY clauses
Date
Msg-id AANLkTik+Btrc9NTucJZsdUf6LaRPjdFrUtJmpgCvvmH6@mail.gmail.com
Whole thread Raw
In response to Re: Parsing of aggregate ORDER BY clauses  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Parsing of aggregate ORDER BY clauses
List pgsql-hackers
On Tue, Jul 27, 2010 at 7:16 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Daniel Grace <dgrace@wingsnw.com> writes:
>>  But if we SELECT
>> SOME_INTEGER_AGGREGATE(DISTINCT floatcol ORDER BY floatcol), should
>> the DISTINCT operate on floatcol (i.e. 1.1 and 1.2 are distinct, even
>> if it means the function is called with '1' twice) or
>> floatcol::integer (1.1 and 1.2 are not distinct)?
>
> Yes.  The current implementation has the advantage that any
> unique-ifying step is guaranteed to produce outputs that are distinct
> from the point of view of the aggregate function, whereas if we try to
> keep the two operations at arms-length, then either we lose that
> property or we sort-and-unique twice :-(.

Am I misreading this, or did you just answer an "either-or" question with "yes"?

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


pgsql-hackers by date:

Previous
From: David Fetter
Date:
Subject: Review: Re: [PATCH] Re: Adding xpath_exists function
Next
From: Robert Haas
Date:
Subject: Re: Review: Re: [PATCH] Re: Adding xpath_exists function