-- 执行时间长sql
SELECT * from information_schema.`PROCESSLIST` WHERE Time > 1000 AND db = 'cdc' ORDER BY TIME desc;
-- 查询表锁
show OPEN TABLES where In_use > 0;
-- 显示正在运行的进程
show processlist;
-- 1:查看当前的事务
SELECT * FROM INFORMATION_SCHEMA.INNODB_TRX;
-- 2:查看当前锁定的事务
SELECT * FROM INFORMATION_SCHEMA.INNODB_LOCKS;
-- 3:查看当前等锁的事务
SELECT * FROM INFORMATION_SCHEMA.INNODB_LOCK_WAITS;