3 ms·
If you use read committed, row based replication and explicit locks where necessary, rather than the default of repeatable read, avoiding deadlock isn't too har
by barrkel 8y ago
If 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.