查看锁情况(MySQL 8.0)

查看锁情况(MySQL 8.0)

SELECT * FROM performance_schema.events_statements_history
WHERE thread_id IN (
SELECT b.`THREAD_ID`
FROM sys.`innodb_lock_waits` a
INNER JOIN performance_schema.threads b ON a.`blocking_pid` = b.`PROCESSLIST_ID`
)
ORDER BY timer_start ASC;

 

你可能感兴趣的:(mysql,mysql,数据库,sql)