一、显示全量有哪些线程在运行,可以检查当前数据库的运行状态
show full processlist
二、按照执行时间降序排序
SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST WHERE COMMAND = 'Query' order by time desc
三、找出运行时间超过1秒的process的ID
SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST WHERE COMMAND = 'Query' AND TIME > 1;
执行结果如下: