Re: Embarassing GROUP question - Mailing list pgsql-general

From Sam Mason
Subject Re: Embarassing GROUP question
Date
Msg-id 20091003173126.GG5407@samason.me.uk
Whole thread Raw
In response to Re: Embarassing GROUP question  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Embarassing GROUP question
List pgsql-general
On Sat, Oct 03, 2009 at 01:05:49PM -0400, Tom Lane wrote:
> What you might be after is something like Postgres' DISTINCT ON
> feature

Yup, looks that way to me as well.

> I have never really played around with this aspect of MySQL ...

Me neither.

> but looking at this example, and presuming that you find that
> it actually does something useful, I wonder whether they interpret
> the combination of GROUP BY and ambiguous-per-spec ORDER BY
> in some fashion similar to DISTINCT ON.

Yup, does look that way doesn't it.  It's still a weird pair of
semantics to conflate.

Hum, if they were assuming that you'd always have to implement GROUP BY
by doing a sort step first then I can see why they'd end up with this.
But if you want to do *anything* else (i.e. hash aggregate in PG) then
you want to keep the semantics of GROUP BY and ORDER BY separate as the
spec and indeed PG does.

--
  Sam  http://samason.me.uk/

pgsql-general by date:

Previous
From: Sam Mason
Date:
Subject: Re: Procedure for feature requests?
Next
From: Tom Lane
Date:
Subject: Re: Procedure for feature requests?