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

Home -> Community -> Usenet -> c.d.o.misc -> Re: Strange Oracle Optimization

Re: Strange Oracle Optimization

From: Daniel Morgan <damorgan_at_exxesolutions.com>
Date: Sun, 13 Jul 2003 16:04:04 -0700
Message-ID: <3F11E564.9471EAF5@exxesolutions.com>


Kin Ng wrote:

> Actually the query returns LOTs of rows. It just took a long time
> (and err out) for a Large set of rows. I started trying to do ROWNUM
> = 1 and it returned FAST. Then I tried ROWNUM < 1000 and it returned
> a thousand rows fast. Then I tried ROWNUM < 10,000, then 1 million
> and finally ROWNUM > 0 and ALL cases it returned lots of rows and
> FAST.
>
> > > Why adding this makes a query run so much faster?

To answer your question requires running EXPLAIN PLAN on both versions ... with and without the added clause.

BTW: Something you should be doing with every SQL statement you write.

--
Daniel Morgan
http://www.outreach.washington.edu/extinfo/certprog/oad/oad_crs.asp
damorgan_at_x.washington.edu
(replace 'x' with a 'u' to reply)
Received on Sun Jul 13 2003 - 18:04:04 CDT

Original text of this message

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