So I am trying to learn MySQL and I came across the isolation levels (SERIALIZED, REPEATABLE READ, READ COMMITED, READ UNCOMMITED
)
I believe my question is quite simple, but I did not find any information in the web so here it goes:
If I change the default REPEATABLE READ
to SERIALIZED
or even from READ UNCOMMITED
to another higher level of isolation does I have less probabilities of having deadlock problems?
Thanks in advance!
The possibility of deadlocks is not affected by isolation level. Isolation level changes the behavior of read operations, but deadlock occurs due to write operations. However, isolation level sets fewer locks, hence it can help you to avoid certain lock types (e.g. gap locking).
These tips to avoid dead_lock are very helpful https://www.percona.com/community-blog/2018/09/24/minimize-mysql-deadlocks-3-steps/