Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

If some one has a Table structure some thing like this,

CREATE TABLE IF NOT EXISTS `domain_source` (`nid` int(11) NOT NULL DEFAULT '0', `domain_id` int(11) NOT NULL DEFAULT '0', PRIMARY KEY (`nid`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Stores the canonical domain for each node.';

On Heavy load i get Deadlock on Insert to this Table Structure. I usually delete and insert a row in the table rather than update as the engine is Innodb.

share|improve this question
up vote 1 down vote accepted

Why DELETE+INSERT instead of UPDATE ??

Do you have BEGIN...COMMIT around the statements?

Are you hitting multiple rows in the DELETE and/or INSERT?

Are you doing DELETE ... WHERE domain_id = ... ? If so, notice that you have no index, hence it will have to scan the whole table!

(Sorry, that does not even begin to answer the question you posed. But it may lead to a solution to the real question.)

share|improve this answer
Thanks rick, definitely it would help. I will focus on analyzing in that direction. – Dinesh Kumar Sarangapani Sep 13 '12 at 4:52

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.