Re: The job of a relational DBMS
Date: Wed, 2 Dec 2009 06:53:43 -0800 (PST)
On Dec 2, 2:13 am, Shakespeare <what..._at_xs4all.nl> wrote:
> Thomas Kellerer schreef:
> > Gene Wirchenko wrote on 01.12.2009 05:35:
> >> For example, a group by in SQL forces the result to be sorted by
> >> the grouping unless otherwise overridden.
> > Never has been true. Group by does *not* sort the result. Not even in
> > Oracle 8 and and certainly not for any Oracle version > 9 (and not for
> > any Postgres as well)
> > Thomas
> Never? It did at least in Oracle 7. As a well known and too many times
> used side effect. I remember having to reprogram queries because
> developed programs relied on the sort....
Oracle never sorted the result set, it sorted the table data to effect grouping. That the result set retained the ordering enforced to provide a group by result was, and is, a side effect of the operation. In that regard Oracle still sorts (orders) the groupings, they're simply in hash key order rather than column order. Still, it's not the result set being ordered, it's the interim processing doing the ordering. And, as stated earlier, it was merely a happy coincidence that the one affected the other.
David Fitzjarrell Received on Wed Dec 02 2009 - 08:53:43 CST