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 -> Question about fetch huge number of records!

Question about fetch huge number of records!

From: music4 <music4_at_163.net>
Date: Thu, 17 Jul 2003 10:03:50 +0800
Message-ID: <bf5084$dht@netnews.proxy.lucent.com>


Greetings,

I am developing an application using C++, and using OCI to access Oracle database.

One process read data from a table, let' call it TA, and handle each record read from TA. The code is like following:

select fields from TA;
set prefetch rows to 200.
loop

    fetch a record
    handle the record
    sleep a while
end loop

For some reason, I have to slow down the speed of fetch, so I have a "sleep" in the loop. So that, each second, only about 20 records are fetched.

But sometime, TA initially contains a huge number of records (more than 400k records), so the fetch will take a very long time (several hours).

MY QUESTION IS: Will that cause server resource (memory, CPU) are seized for the selection??? Since server need to keep the selection result.

If this is not a good way, do you have an alternation?

Thanks in advance!
Evan Received on Wed Jul 16 2003 - 21:03:50 CDT

Original text of this message

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