Click here to Skip to main content
14,971,296 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
Hi everybody,

I've developed an application that need to to insert a lot of data at a time and also need speed. If i i insert data sequentially, it run very slow. So, i 've create some Thread (about 30 threads, use ThreadPool) for inserting. But the speed is not imporoved. It is even slower than when i insert sequentially. How to solve this? are there any options while installing for concurrently insert?

Currently, I use Oracle 10g (10.2.0) on Windows 7 64bits and i've installed it with basic option(default option). Do i have to change to Oracle 11g? If need, i'll change.


-------------------------------------------------------------------
It's seem faster when i create 30 Oracle account. Then, each thread uses an account to connect to Oracle and execute some insert statements. Is this a right method??
Posted
Updated 12-Jun-11 6:06am
v4

Adding threads won't help you. Adding more threads than you have cores is even worse.

Changing the client version won't make anything faster. The problem is with your technique.

Setup your data in whatever container you need to to use Oracles Bulk Insert[^].
   
Comments
thanhvinh0906 12-Jun-11 12:03pm
   
It's seem faster when i create 30 Oracle account. Then, each thread uses an account to connect to Oracle and execute some insert statements. Is this a right method??
Dave Kreskowiak 12-Jun-11 12:13pm
   
No, it's not. I just got done telling you that.
thanhvinh0906 12-Jun-11 13:10pm
   
But, in my situation, It's faster. I don't know why. If i use just one connection to execute all store procedure (i use store procedure to insert data), it takes from 3 to 4 seconds. When i use about 10 connections, it takes about 900 miliseconds to 2 seconds. I've tested it many times. Can you explain it for me? Thank you very much!
Dave Kreskowiak 12-Jun-11 15:06pm
   
You want it to go faster, correct? Ditch the threads and use bulk insert.
thanhvinh0906 13-Jun-11 2:41am
   
Thank you! I'll try it
thanhvinh0906 13-Jun-11 6:50am
   
Thanks, i've used bulk insert. It's faster than i expected. Great!
RakeshMeena 24-Jun-11 2:45am
   
My 5!
if u want to improve performance of ur application


u require to use stored procedures to interact with database

not only that


make some settings in configuration file


use 'compilation = false' to dont make compilation every time when u hosted on internet
   

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900