Re: Grouping by date range

From: Bruno Wolff III <bruno(at)wolff(dot)to>
To: Ron Johnson <ron(dot)l(dot)johnson(at)cox(dot)net>
Cc: PgSQL General ML <pgsql-general(at)postgresql(dot)org>
Subject: Re: Grouping by date range
Date: 2003-08-20 19:16:17
Message-ID: 20030820191617.GA30279@wolff.to
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Wed, Aug 20, 2003 at 14:02:59 -0500,
Ron Johnson <ron(dot)l(dot)johnson(at)cox(dot)net> wrote:
> On Wed, 2003-08-20 at 13:58, Bruno Wolff III wrote:
> > On Wed, Aug 20, 2003 at 13:44:59 -0500,
> > Ron Johnson <ron(dot)l(dot)johnson(at)cox(dot)net> wrote:
> > >
> > > The GROUP BY does implicit sorting, so an ORDER BY on the exact same
> > > column(s) as the GROUP BY is redundant.
> >
> > That is an implementation detail, not a promise. With hashed aggregates
> > in 7.4, you might find this isn't true.
>
> Now that's interesting. I'd have gone to my grave thinking it was
> part of the spec...

I just tried something out quick and a select with group by didn't
return the data in ascending order. (This is on CVS from about a week ago.)

bruno=> create table temp (col int);
CREATE TABLE
bruno=> insert into table values (3);
ERROR: syntax error at or near "table" at character 13
bruno=> insert into temp values (3);
INSERT 182888 1
bruno=> insert into temp values (1);
INSERT 182889 1
bruno=> insert into temp values (2);
INSERT 182890 1
bruno=> analyze temp;
ANALYZE
bruno=> select * from temp group by col;
col
-----
3
2
1
(3 rows)

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Jean-Luc Lachance 2003-08-20 19:24:30 Re: Mailing list in French
Previous Message The Hermit Hacker 2003-08-20 19:13:31 Re: Mail server load