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语句后进行分析即可
使用top-Hp<PID>命令可以查看指定进程的详细信息。结合SQL查询,从information_schema.PROCESSLIST和performance_schema.threads表中根据thread_os_id或thread_id定位到具体的SQL语句,进一步进行性能分析。
1536

被折叠的 条评论
为什么被折叠?



