Oracle FAQ Your Portal to the Oracle Knowledge Grid

Home -> Community -> Mailing Lists -> Oracle-L -> RE: [SPAM] 10gR2 Upgrade .. Watch out

RE: [SPAM] 10gR2 Upgrade .. Watch out

From: Ken Naim <>
Date: Wed, 27 Dec 2006 18:24:12 -0500
Message-ID: <00a601c72a0e$20d7a2a0$91b016ac@KenHome>

I agree. I just don't understand how many times this topic has to said "if you want data ordered use an order by otherwise there no guarantee to the order". Everyone at Oracle says, every good oracle professional repeats it. The CBO won't do an unnecessary sort if it knows the data is sorted correctly due to the use of an index or such.

If the order by puts so much over head that query doesn't run as fast you would like then there are bigger issues at play.

Sorry for my rant but this is a big pet peeve of mine. I didn't realize this issue was just a non issue regarding sort, initially I misread it as wrong data returning.


-----Original Message-----
From: [] On Behalf Of Wolfgang Breitling
Sent: Wednesday, December 27, 2006 6:16 PM To:
Cc: Mark J. Bobak; oracle-l
Subject: Re: [SPAM] 10gR2 Upgrade .. Watch out

At 03:42 PM 12/27/2006, GovindanK wrote:
>You are correct .. order of output is not guaranteed unless one
>specifies an 'order by' clause explicitly .. but it certainly looks
>unacceptable when the default behaviour changes across upgrades .. in
>9iRel2 Oracle was doing the sort implicitlly (which should not have been
>the case) and they left it high and dry in 10gRel2 reverting back to the
>"expected" behaviour .. this results in the mismatch of the output order
>across upgrades.

As far as I'm concerned it merely exposes a bug in your application code, relying on group by to return the result set in a certain order. Just because it happens to work in some cases (here Oracle pre 10gR2) does not make it the default behaviour. It was just a side effect of an implementation detail. The default behaviour is that without the order by caluse Oracle can return the resultset in any order it darn well pleases, including in the group by order, but it doesn't have to. And Oracle warned all along not to rely on it.


Wolfgang Breitling
Centrex Consulting Corporation


Received on Wed Dec 27 2006 - 17:24:12 CST

Original text of this message