~~REDIRECT>percona-server:features:innodb_deadlock_count~~ ====== Patch: innodb_deadlock_count ====== The patch is provided by Eric Bergen under BSD license (see [[ http://ebergen.net/wordpress/2009/08/27/innodb-deadlock-count-patch/ | InnoDB Deadlock Count Patch]]). It adds a new global status variable (Innodb_deadlocks) showing the number of deadlocks*. You can use it with SHOW GLOBAL STATUS: mysql> SHOW GLOBAL_STATUS LIKE 'Innodb_deadlocks'; +------------------+-------+ | Variable_name | Value | +------------------+-------+ | Innodb_deadlocks | 323 | +------------------+-------+ or with INFORMATION_SCHEMA: mysql> SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'Innodb_deadlocks'; +----------------+ | VARIABLE_VALUE | +----------------+ | 323 | +----------------+ *A deadlock will occur when at least two transactions are mutually waiting for the other to finish, thus creating a circular dependency that lasts until something breaks it. InnoDB is quite good at detecting deadlocks and generally returns an error instantly. Most transactional systems have no way to prevent deadlocks from occurring and must be designed to handle them, for instance by retrying the transaction that failed. ===== Version-Specific Information ===== ^ Percona-Server Version ^ Comments ^ | [[http://www.percona.com/docs/wiki/percona-server:release_notes_51#release_5147-110|5.1.47-11.0]] | Full functionality available. | ===== Related Reading ===== Original [[ http://ebergen.net/wordpress/2009/08/27/innodb-deadlock-count-patch/ | post]] by Eric Bergen