shawon Posted September 18, 2004 Posted September 18, 2004 Currently we have a database with about 100/more tables in it and to insert an entry it takes about 50 seconds. So, i was wondering if I could make the process little faster; i attempted to do it using .net threading but i keep getting deadlocks. basically what I tried using an array of objects where each element takes the number of rows to insert, a sql connection and a sql transaction object and the whole object is locked internally. i was having the impression that since each element of the array is getting its own sql/trans object and the object itself is locked, it won't share the conn/trans with other threads but thats not the case. i know this is probably not the right way to thread stuff but thats all i could come up with, please feel free to give me other options.n any help would be appreciated. thank you noyeem Quote
Joe Mamma Posted September 18, 2004 Posted September 18, 2004 50 seconds for a single query? somethings not right here. what database flavor? is this a batch situation? Quote Joe Mamma Amendment 4: The right of the people to be secure in their persons, houses, papers, and effects, against unreasonable searches and seizures, shall not be violated, and no warrants shall issue, but upon probable cause, supported by oath or affirmation, and particularly describing the place to be searched, and the persons or things to be seized. Amendment 9: The enumeration in the Constitution, of certain rights, shall not be construed to deny or disparage others retained by the people.
Administrators PlausiblyDamp Posted September 18, 2004 Administrators Posted September 18, 2004 What database are you using? How are you doing the insert (any chance of some code)? Is the insert modifying a single table or multiple tables? Are the tables heavily indexed or have any triggers attached? What other processes may be accessing the DB at the same time? You will probably find that the threads are having to wait on previous updates to complete due to DB locking etc, which is why you are not getting any noticable benefits from threads in this case. Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.