Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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

Posted
50 seconds for a single query? somethings not right here. what database flavor? is this a batch situation?

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
Posted

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.

Posting Guidelines FAQ Post Formatting

 

Intellectuals solve problems; geniuses prevent them.

-- Albert Einstein

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...