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: Tanel Põder <tanel.poder.003_at_mail.ee>
Date: Tue, 18 May 2004 13:05:04 +0300
Message-ID: <01e101c43cbf$97882a80$84bc9fd9@porgand>


> When trying out hints I only focused on no_unnest and totally forgot about
> no_merge which should have been the more obvious one. That is consistent
> with the result I got using the rownum pseudo-column which also prevents
> merging.

NO_MERGE causes CBO to be used and under CBO the query works correctly (even without NO_MERGE) as Connor pointed out.

If you set _complex_view_merging to false, then the query works ok under RBO as well...

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

    DEPTNO


        20
        20
        20

SQL> alter session set "_complex_view_merging"=false;

Session altered.

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

    DEPTNO


        20

Tanel.



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 Tue May 18 2004 - 05:02:23 CDT

Original text of this message

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