3 ms·
On the other hand, you hardly every have to worry about weird locking problems. It's nearly impossible to avoid deadlock in any reasonable complex use of MySQL
by paulddraper 8y ago
On the other hand, you hardly every have to worry about weird locking problems.
It's nearly impossible to avoid deadlock in any reasonable complex use of MySQL.
- barrkel 8y agoIf you use read committed, row based replication and explicit locks where necessary, rather than the default of repeatable read, avoiding deadlock isn't too hard. It's usually the gap locks that bite you, I've found. https://www.percona.com/blog/2012/03/27/innodbs-gap-locks/ https://www.percona.com/blog/2012/03/27/innodbs-gap-locks/ Oh, and do all your deletes by primary key. Deletes with joins are especially good for creating too many locks.