查询事务间锁等待情况(trx_lock_wait)

11月 29, 2021 |

不适合mysql8, 请使用从mysql7开始就支持的 select * from sys.innodb_lock_waits

相关表解释

from information_schema.INNODB_LOCK_WAITS 事务对锁等待
information_schema.innodb_trx 事务列表(trx_id, trx_mysql_thread_id=processlist_id)
information_schema.processlist 进程列表processlist_id
performance_schema.threads processlist_id 和thread_id映射
performance_schema.events_statements_history 每个thread_id执行的最后10条sql

具体sql

Posted in: database

Comments are closed.