Query hints and isolation levels help you to have more control over how your query is executed by MySQL. Before we discuss these topics, let's go over what locking, blocking, and deadlocking mean.
Using query hints and transaction isolation levels
Understand the concepts of locking, blocking, and deadlocking
Locking is what happens when a query runs against a database. There are read locks and write locks:
- Read locks: Allow other queries reading data (SELECT) to read as well.
- Write locks: Other queries can't read or write data until the write (INSERT, UPDATE, DELETE) query is complete.
Blocking can happen when one or more queries holds a lock on the same data. Deadlocking can happen when each query locks data...