mysql如何定位占用cpu高的sql

获取消耗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)