MySQL Forums
Forum List  »  InnoDB

Re: Deadlock found when atempting to insert and update from diferent tx.
Posted by: Rick James
Date: July 25, 2011 09:31AM

> So when we removed the "for update" the previously described problem arised.
Well, Duh? You get a choice -- Deadlocks or slowdowns.

Why are two processes trying to do the same update on the same row? Maybe the problem is in the overall design of the system??

On a less sarcastic note...

> UPDATE users SET score=10 WHERE id=1;
Instead of dynamically updating information, can you compute when you need it? That is,
* Remove the UPDATE, and keep the INSERT that shows the incremental 10 points.
* Calculate something like SELECT SUM(...) AS score FROM ...

Options: ReplyQuote




Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.