Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> Re: Puzzling execution plan
On 06/12/2004 04:17:26 PM, Don Granaman wrote:
> (Oracle 9.2.0.4) This doesn't make sense to me...
> How does this make sense? What might make an optimizer with fresh
> statistics so badly munge the execution plan for Q1 & Q2? This was in a
> database with no tweaks to OIC/etc. A hint "fixes" Q1 and Q2, but it seems
> one should not be necessary.
>
> -Don Granaman
> puzzled OraSaurus
At the first glance, it looks like a bug, because in the first two cases, you're comparing to result of a function, while the 3rd example looks like a constant. Try setting event 10053, level 10 and see the trace file. Trace file should reveal each step optimizer takes and you'll see what does it do differently in queries 1 and 2 as opposed to 3. This is what the command looks like:
Connected to:
Oracle Database 10g Enterprise Edition Release 10.1.0.2.0 - Production
With the Partitioning, OLAP and Data Mining options
SQL> alter session set events='10053 trace name context forever, level 10';
Session altered.
SQL> This is the trace it produces in BACKGROUND_DUMP_DEST directory:
(14 uncompressed buckets and 14 endpoint values) TABLE: EMP Alias: EMP
-- Mladen Gogala Oracle DBA ---------------------------------------------------------------- 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 Sat Jun 12 2004 - 02:08:27 CDT
![]() |
![]() |