Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Retrieving a set of randomly chosen records (Oracle 9i)
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