From: | Paolo Tavalazzi <ptavalazzi(at)charta(dot)it> |
---|---|
To: | Bruno Wolff III <bruno(at)wolff(dot)to> |
Cc: | pgsql-general(at)postgresql(dot)org |
Subject: | Re: postgres FROM clause problem (GROUP BY subquestion) |
Date: | 2004-03-12 08:47:49 |
Message-ID: | 200403120947.50102.ptavalazzi@charta.it |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
Alle 20:14, giovedì 11 marzo 2004, hai scritto:
> On Thu, Mar 11, 2004 at 09:43:57 +0100,
>
> Paolo Tavalazzi <ptavalazzi(at)charta(dot)it> wrote:
> > Alle 19:12, mercoledì 10 marzo 2004, hai scritto:
> > > On Wed, Mar 10, 2004 at 18:33:41 +0100,
> > >
> > > Paolo Tavalazzi <ptavalazzi(at)charta(dot)it> wrote:
> > > > I don't know what to make, help me please!
> > > >
> > > > Another question, in 7.4 GROUP BY clause not guarantee the ordering
> > > > of result. Can I desable the new group by algorithm to maintain the
> > > > coherence whit the programs that I have in production with pg_7.3
> > >
> > > GROUP BY never guarenteed an order. That this happened in 7.3 was an
> > > implementation detail. If you want a specific order you need to use an
> > > ORDER BY clause.
> >
> > Seeing that GROUP BY in 7.3 required sorting the input data to bring
> > group members together, this guaranteed to me also the order of the
> > attributes in GROUP BY clause.
>
> This might be a language difference. You weren't guarenteed (or promised)
> that the output would be sorted. It just happened that way because of how
> the database implemented the group by. By reading the source code for
> that version it would be possible to determine that the output would
> always be sorted. However, that could change at any upgrade or if you
> switched databases.
You have reason.
My deduction comes only from the reading of the code.
I thought to have read it also in the postgres documentation,but it is not
true.
I have seen that the algorithm of group by in 7.4 is various then 7.3,and it
seems more efficent.
Therefore, i have changed my program to manage the order by clause.
Thank you
From | Date | Subject | |
---|---|---|---|
Next Message | Paolo Tavalazzi | 2004-03-12 12:14:32 | Re: postgres FROM clause problem |
Previous Message | Reece Hart | 2004-03-12 05:29:51 | Re: Question on Opteron performance |