1.关闭
index_merge_intersection=off
2.shell脚本
while ((1)); do sleep 1 ; /apps/svr/mysql57/bin/mysql -uroot -padminadmin -A -S /tmp/mysql3307.sock --default-character-set=utf8 -e "select count(*),left(info,100) from information_schema.processlist where command<>'sleep' and info <>'null' group by left(info,100) order by count(*) desc" >>/tmp/zdx_trace20181111.log; date >>/tmp/zdx_trace20181111.log; done
其他查看某个语句出现次数
select id,user,host,db,COMMAND,substring(info,1,50) as info ,time as 'time(秒)'
from information_schema.processlist
where COMMAND not in('Sleep','Binlog Dump','Daemon')
and info like '%order by shipmenthe0_.CREATED_DTM_LOC asc limit 1%'
order by TIME desc limit 50;
浙公网安备 33010602011771号