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-down_with_spammers_at_attbi.com>
Date: Wed, 09 Apr 2003 13:26:02 GMT
Message-ID: <JbVka.66202$ug3.134789@rwcrnsc51.ops.asp.att.net>

  1. "select the first 5,000 records" Means you are going to select some 5,000 records; in a table there is no first record. If you want some first part of the result set then you need to order that result set.
  2. rownum<x means that Oracle can possibly be more efficient since it know when to stop. Jim
--
Replace part of the email address: kennedy-down_with_spammers_at_attbi.com
with family.  Remove the negative part, keep the minus sign.  You can figure
it out.
"music4" <music4_at_163.net> wrote in message
news:b70gug$qid_at_netnews.proxy.lucent.com...

> Dear Oracle Guru,
>
> I am writing a Oracle application using OCI. I use C++ on Solaris
platform.
>
> 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?
>
> Thanks in advance!
> evan
>
>
Received on Wed Apr 09 2003 - 08:26:02 CDT

Original text of this message

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