MySQL性能优化

SHOW VARIABLES LIKE ‘%slow%’
在这里插入图片描述
SET @@global.slow_query_log = ON;
在这里插入图片描述
SET @@global.log_output=‘TABLE’;
可以查看慢查询的语句,包含慢查询的SQL、执行时间、频率等
在这里插入图片描述
SET GLOBAL long_query_time = 2
设置大于long_query_time秒的查询
模拟一下
SELECT SLEEP(10);

*【很实用】MySQL优化技巧:https://blog.csdn.net/u013087513/article/details/77899412

posted @ 2018-11-16 14:57  小漆同学  阅读(90)  评论(0)    收藏  举报