Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: What index access path does INDEX_SS yield ?
Jonathan Lewis wrote:
> "John K. Hinsdale" <hin_at_alma.com> wrote in message
> news:1168050283.611090.194630_at_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 >>
Thanks Jonathan and John.
-- Daniel A. Morgan University of Washington damorgan_at_x.washington.edu (replace x with u to respond) Puget Sound Oracle Users Group www.psoug.orgReceived on Sat Jan 06 2007 - 15:12:54 CST
![]() |
![]() |