top命令查看
根据PID查找
top -Hp 2603
根据PID定位对应sql
SELECT
a. USER,
a. HOST,
a.db,
b.thread_os_id,
b.thread_id,
a.id processlist_id,
a.command,
a.time,
a.state,
a.info
FROM
information_schema.PROCESSLIST a,
performance_schema.threads b
WHERE
a.id = b.processlist_id
AND b.thread_os_id = 2530;
info对应sql语句,或者使用以下sql定位对应语句
SELECT
*
FROM
performance_schema.events_statements_current
WHERE
thread_id = (
SELECT
thread_id
FROM
performance_schema.threads
WHERE
thread_os_id = 2530
) ;
找到对应sql语句后进行分析即可