| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Question about fetch huge number of records!
Use the array interface and fetch them 200 at a time with no sleep between.
I've never had to do that. The other day I did a similar thing but with an
insert. I used the array interface and inserted almost 500 rows at a shot
very quickly. (under .05 of a sec) The rows were very narrow.(1 sequential
number and a text string of 15 bytes)
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:bf5084$dht_at_netnews.proxy.lucent.com...Received on Wed Jul 16 2003 - 22:00:42 CDT
> 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
>
>
![]() |
![]() |