https://blog.csdn.net/qq_37574218mysql
https://blog.csdn.net/weixin_43306831/article/details/94662872#1__10sql
通常应急调优的思路:session
一、show processlist ##获取当前全部链接session状态 二、explain select id ,name from stu where name='clsn'; # ALL id name age sex select id,name from stu where id=2-1 函数 结果集>30; show index from table; 三、经过执行计划判断,索引问题(有没有、合不合理)或者语句自己问题 四、show status like '%lock%'; # 查询锁状态 kill SESSION_ID; # 杀掉有问题的session
一、查看 slowlog,分析 slowlog,分析出查询慢的语句。 二、按照必定优先级,进行一个一个的排查全部慢语句。 三、分析 top sql,进行 explain 调试,查看语句执行时间。 四、调整索引或语句自己。