Debugging Blocking Sessions in MySQL
When a MySQL query is blocked, find the session holding the lock, inspect the transaction that owns it, and then decide whether to wait, end the connection, or…
Read articleWhen a MySQL query is blocked, find the session holding the lock, inspect the transaction that owns it, and then decide whether to wait, end the connection, or…
Read articleWhen code using MySQL's InnoDB storage engine encounters a deadlock, two transactions are waiting for locks held by each other. The code must rerun the entire transaction after…
Read articleWhen MySQL’s InnoDB storage engine inserts rows into a table with an AUTOINCREMENT column, it assigns generated numbers and coordinates concurrent inserts so they receive distinct values. InnoDB…
Read articleIn MySQL’s InnoDB storage engine, an insert waits when another transaction holds a lock on the index position where the new row belongs, even if that transaction is…
Read articleWhen a MySQL query reads rows that a later statement depends on, use a locking read inside an explicit transaction, a group of statements you start and finish…
Read articleIn a production MySQL database, a transaction is a group of database statements that MySQL commits together or rolls back. A lock wait timeout means a statement waited…
Read articleWhen you add a composite index to a MySQL table, the order of its columns determines which queries can use it efficiently. A composite index is one index…
Read articleWhen a MySQL database responds slowly, the SQL statements taking the most time are a useful place to investigate. The slow query log records statements that exceed a…
Read articleWhen you insert a row into a MySQL table, you may need to add it if no row has its key, or update the row that already has…
Read articleWhen a MySQL transaction checks a row before doing related work, another transaction can change the row before the next statement runs. InnoDB locking reads prevent that change…
Read articleWhen several requests read or change the same MySQL data, MySQL’s InnoDB storage engine uses locks to coordinate them. A transaction groups database operations into one unit and…
Read articleWhen a query in MySQL's InnoDB storage engine makes another query wait, InnoDB usually locks entries in an index that the first query scanned, or a span of…
Read article