![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
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 |
#3
| ||||
| ||||
|
|
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? |
![]() |
| Thread Tools | |
| Display Modes | |
| |