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

Home -> Community -> Usenet -> c.d.o.server -> Re: What index access path does INDEX_SS yield ?

Re: What index access path does INDEX_SS yield ?

From: John K. Hinsdale <hin_at_alma.com>
Date: 5 Jan 2007 18:24:43 -0800
Message-ID: <1168050283.611090.194630@s80g2000cwa.googlegroups.com>

> Jonathan Lewis wrote:
> > Very few of them said things like "Oracle is ignoring my
> > subquery" - and I don't think I've ever seen anyone reply
> > "that's because Oracle can ignore subqueries".

DA Morgan wrote:
> Your last comment caught my interest. Would you have an example
> of Oracle ignoring a subquery you could share?

I doubt this is the interesting example Dan is looking for, but a very trivial degenerate case, using the demo "SH" (Sales History) schema shipped w/ 10g:

SELECT *
FROM customers
WHERE 1 = 1
  OR cust_id IN ( SELECT cust_id

                   FROM customers
                   WHERE cust_id = 100
                 )

will do a full scan and ignore the subquery completely. I imaginge there is a more interesting case where Oracle will decide a subquery doesn't affect the results and can be optimized out. I presume that is the only time the optimizer is free to ignore them?

Here is proof from a running instance that SQL above optimizes into the full scan as claimed:

http://otb.alma.com/otb.fcgi?func=sqlexplain&server=orcl&user=SH&qid=23

A more interesting example -- or general description of how/when the phenomemon occurs, would be enlightening.

Cheers,

John Hinsdale Received on Fri Jan 05 2007 - 20:24:43 CST

Original text of this message

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