Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> RE: 9205 Query behavior
Well, Oracle *did* say that rule optimizer was on the way out...
SQL> select *
2 from
3 ( select distinct deptno
4 from ( select deptno, job, min(sal) 5 from scott.emp 6 group by deptno, job ) 7 where deptno = 20 )
DEPTNO
20 20 20
3 rows selected.
SQL> select /*+ ALL_ROWS */ *
2 from
3 ( select distinct deptno
4 from ( select deptno, job, min(sal) 5 from scott.emp 6 group by deptno, job ) 7 where deptno = 20 )
DEPTNO
20
1 row selected.
Have to admit - there's been plenty of times in the past when 'rule' worked when a CBO decision gave incorrect results. Nice to see CBO getting its own back :-)
Cheers
Connor
Coming Soon! "Oracle Insight - Tales of the OakTable"
"GIVE a man a fish and he will eat for a day. But TEACH him how to fish, and...he will sit in a boat and drink beer all day"
-- 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 - 02:48:04 CDT
![]() |
![]() |