获取消耗cpu大的thread_id
pidstat -t -p mysqldpid 1 3
获取processlist_id
select processlist_id from performance_schema.threads where thread_os_id = thread_id;
获取sql
select info from information_schema.PROCESSLIST where id=processlist_id
获取消耗cpu大的thread_id
pidstat -t -p mysqldpid 1 3
获取processlist_id
select processlist_id from performance_schema.threads where thread_os_id = thread_id;
获取sql
select info from information_schema.PROCESSLIST where id=processlist_id
本文标题:mysql如何定位占用cpu高的sql
本文链接:https://www.haomeiwen.com/subject/ywbqoltx.html
网友评论