Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> Re: 9205 Query behavior

Re: 9205 Query behavior

From: Wolfgang Breitling <breitliw_at_centrexcc.com>
Date: Mon, 17 May 2004 09:42:34 -0600
Message-Id: <6.1.0.6.2.20040517093810.02b061b8@pop.centrexcc.com>


I wonder what kind of optimizer bug it is. I tried various hints, even RULE !, to no avail. However, adding rownum to the innermost sql produces the expected result:

SQL> l

   1 select distinct deptno from ( select rownum, deptno, job,    2* min(sal) from scott.emp group by rownum, deptno, job) SQL> /      DEPTNO


         10
         20
         30

3 rows selected.

SQL> l

   1 select * from ( select distinct deptno from ( select rownum, deptno, job,    2* min(sal) from scott.emp group by rownum, deptno, job) where deptno = 20 ) SQL> /      DEPTNO


         20

1 row selected.

That seems to indicate some unnesting related error. However, using no_unnest hints does not change the behaviour.

At 03:55 PM 5/16/2004, you wrote:
>On 9205 database, load $OH/admin/utlsampl.sql
>
>run following query ... and observe ...
>
>set feedback on
>prompt Step 1
>select deptno, job, min(sal) from scott.emp group by deptno, job
>/
>prompt Step 2
>select distinct deptno from ( select deptno, job, min(sal) from
>scott.emp group by deptno, job ) where deptno = 20
>/
>prompt Step 3
>select * from ( select distinct deptno from ( select deptno, job,
>min(sal) from scott.emp group by deptno, job ) where deptno = 20 )
>/

regards

Wolfgang Breitling
Centrex Consulting Corporation
www.centrexcc.com



Please see the official ORACLE-L FAQ: http://www.orafaq.com

To unsubscribe send email to: oracle-l-request_at_freelists.org put 'unsubscribe' in the subject line.
--
Archives are at http://www.freelists.org/archives/oracle-l/
FAQ is at http://www.freelists.org/help/fom-serve/cache/1.html
-----------------------------------------------------------------
Received on Mon May 17 2004 - 10:41:10 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US