One of the more difficult lock contention cases to investigate happens when foreign keys are involved as you can have queries on different table content for the same locks. This case study investigates an example where both metadata and InnoDB record locks occur due to foreign keys. As the symptoms and the cause are the same as for the case study discussing metadata locks in Chapter 14 and the case study of the InnoDB record locks in Chapter 15, these are skipped in this discussion.
17. Case Study: Foreign Keys
Get MySQL Concurrency: Locking and Transactions for MySQL Developers and DBAs now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.