hangkk2008

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

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;

  

posted on 2019-06-24 15:10  鱼儿也疯狂  阅读(219)  评论(0)    收藏  举报