-
2024.07.07 How to Minimize and Handle DeadlocksTIL 2024. 7. 7. 23:10
https://dev.mysql.com/blog-archive/innodb-data-locking-part-1-introduction/
MySQL :: InnoDB Data Locking - Part 1 "Introduction"
In this blog series, I’d like to introduce you gently to the topic on which I was working last 2 years, which is improving how InnoDB locks data (tables and rows) in order to provide illusion to clients that their queries are executed one after another,
dev.mysql.com
앞의 글의 시리즈인데 처음부터 봐야겠다.
음
데드락 줄이는 방법
https://dev.mysql.com/doc/refman/8.4/en/innodb-deadlocks-handling.html
MySQL :: MySQL 8.4 Reference Manual :: 17.7.5.3 How to Minimize and Handle Deadlocks
17.7.5.3 How to Minimize and Handle Deadlocks This section builds on the conceptual information about deadlocks in Section 17.7.5.2, “Deadlock Detection”. It explains how to organize database operations to minimize deadlocks and the subsequent error
dev.mysql.com
- 재시도를 항상 준비할 것
- 트랜잭션의 크기를 작게 잡을 것
- 여러 테이블 수정, 테이블에서 순서가 다른 행 수정을 할 경우 일관된 순서를 지키는 것
- locking read가 필요할 때 read committed를 고려할 것
'TIL' 카테고리의 다른 글
2024.07.10~11 Query Tuning (0) 2024.07.11 2024.07.09 locking Introduction (0) 2024.07.09 2024.07.04~06 deadlock detection (0) 2024.07.07 2024.07.01 wait-for-graph (0) 2024.07.01 2024.06.30 (0) 2024.06.30