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: If select using rownum savs time?

Re: If select using rownum savs time?

From: Jim Kennedy <kennedy-downwithspammersfamily_at_attbi.com>
Date: Wed, 09 Apr 2003 14:20:55 GMT
Message-ID: <b%Vka.120692$OV.219303@rwcrnsc54>


Not really, with rownum the optimizer can choose a different explain plan based upon rownum vs no rownum.
Jim
"andrewst" <member14183_at_dbforums.com> wrote in message news:2746942.1049896185_at_dbforums.com...
>
> Originally posted by Music4
> > I have table that contains a huge number of records (over
> > 100000). And I
> > need to select first 5000 records. In my current application, I
> > just use
> > "select * from the_table", then only petch first 5000 records.
> >
> > And today, I happened to get know "rownum", so I am guess if
> > "select * from
> > the_table where rownum < 5000" would be efficient. Is that true?
> >
> Comes to the same thing, but ROWNUM version is easier to code. Either
> way, you get "first" 5000 rows from table and then stop fetching rows,
> so performance should be the same.
>
> --
> Posted via http://dbforums.com
Received on Wed Apr 09 2003 - 09:20:55 CDT

Original text of this message

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