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: Retrieving a set of randomly chosen records (Oracle 9i)

Re: Retrieving a set of randomly chosen records (Oracle 9i)

From: Malcolm Dew-Jones <yf110_at_vtn1.victoria.tc.ca>
Date: 19 Feb 2005 20:45:55 -0800
Message-ID: <42181603@news.victoria.tc.ca>


andreas.krisor_at_gmx.net (andreas.krisor_at_gmx.net) wrote:
: Hi Malcolm,

: I have at the moment no possibility to try your suggestion but I think
: the ROWNUM refers to the result set of a query, so a full table scan is
: used for this statement which reduces the performance dramatically and
: therefore wouldn't be applicable.

: Am I right?

maybe, I don't know for sure

However my suggestion was less than optimal, not sure what I was thinking. I haven't tested the code but I'm pretty sure you don't need to select from a select, simply

        select * from table where rownum modulus whatever

That could in theory be optimized at the remote end to retrieve only a some of the rows.

As for a full table scan (which I also responded to just above) if you want any kind of randomish sample then surely you will have to scan the whole table - the only issue is whether the remote end can do the scan so as to reduce the amount of data that must be sent.

--

This space not for rent.
Received on Sat Feb 19 2005 - 22:45:55 CST

Original text of this message

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