mysql如何定位占用cpu高的sql
2021-10-10 本文已影响0人
wwq2020
获取消耗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