Skip to Main Content
  • Questions
  • Pro*C Multithread Extracting Table Data

Breadcrumb

Question and Answer

Chris Saxon

Thanks for the question, Biju.

Asked: September 15, 2016 - 7:43 pm UTC

Last updated: September 17, 2016 - 4:25 am UTC

Version: 11.2.0.4.0

Viewed 1000+ times

You Asked

Hi Tom,

I have created pro*c multithreaded application to download data from oracle table to flatfile. Each thread has its own sql context, cursor and fetch statements. I am generating separate WHERE clause for each thread with MOD function on one NUMERIC field. The program gives a throughput of .1 million rows/s. When I increase the thread number to 2, for each thread it gives same throughput, But when its 3 or more, the throughput decreases for each thread.

Is it possible to do pro*c program with only 1 connection, 1 cursor and after opening the cursor separate threads fetch data from the same cursor?


Thanks

and Connor said...

*If* the issue is contention for common blocks in the table, you might get some benefit by accessing different parts of the table using rowid ranges.

See this link for an example

https://asktom.oracle.com/pls/asktom/f?p=100:11:::::P11_QUESTION_ID:10498431232211

But I stress, if the multiple threads are slowing due to (for example):

- network bandwidth
- server overload
- storage bandwidth exhausted

then it might be the case that no matter how you carve up the threads, you wont see any benefits.

Rating

  (2 ratings)

Is this answer out of date? If it is, please let us know via a Comment

Comments

Extending to patitioned tables

Biju Chiramel, September 19, 2016 - 2:37 pm UTC

thank a lot for the query. It works perfectly for non-partitioned tables. Can you please help me to use it for partitioned tables also?

This was perfect

Biju Chiramel, September 27, 2016 - 6:55 pm UTC

I have implemented the pro*c program with multiple rowid limits and its working great. Thanks a lot for the information.