当前位置:网站首页>isn't it?Is there anyone who can't locate the slow query problem of MySQL online?
isn't it?Is there anyone who can't locate the slow query problem of MySQL online?
2022-08-05 11:47:00 【InfoQ】
1. The role of the slow query log
2. Configuration of slow query log
2.1 Check whether slow query log is enabled
show variables like 'slow_query_log';
2.2 Open slow query log
set global slow_query_log=1;
2.3Setting the threshold for slow query logs
set long_query_time=1;
2.4 Modifying the slow query log location
show variables like '%slow_query_log_file%';
2.5 Record more slow query SQL
set global log_slow_admin_statements=ON;
set global log_queries_not_using_indexes=ON;
3. Use of slow query log
select * from user;
cat /usr/local/mysql/data/localhost_slow.log
4. Analyze slow query logs
Common parameters are
-s: Indicates which way to sort:
c: number of visits
l: lock time
r:Return records
t: query time
al: average lock time
ar: average number of returned records
at: average query time
-t: how many previous records are returnedData;
4.1 The 10 SQL with the most returned results:
4.2 The 10 longest SQL queries:
边栏推荐
- #yyds干货盘点#JS数组和树相互转化
- 灰度值与热成像理解
- Go 语言快速入门指南: 基本类型
- swig 语法介绍
- Five reasons why developers choose Klocwork, a static analysis tool for code quality, for software security
- 消息中间件汇总
- 安全软件Avast与赛门铁克诺顿NortonLifeLock合并获英国批准
- hdu1455 Sticks (search+pruning+pruning+.....+pruning)
- 2022 CCF国际AIOps挑战赛决赛暨AIOps研讨会报名已开启
- 机器学习——逻辑回归
猜你喜欢
使用Netty编写通用redis客户端(可指定服务器地址与端口号连接任意redis)
Go编译原理系列9(函数内联)
Naive bayes
The importance of parameter naming, remember a JDBC parameter conflict
STM32H743IIT6学习笔记01——CubeMX新建工程文件
互联网行业凛冬之至,BATM的程序员是如何应对中年危机的?
2022 CCF国际AIOps挑战赛决赛暨AIOps研讨会报名已开启
训练集Loss收敛,但是测试集Loss震荡的厉害?
Gray value and thermal imaging understanding
Four, kubeadm single master
随机推荐
The importance of parameter naming, remember a JDBC parameter conflict
WPF开发随笔收录-WriteableBitmap绘制高性能曲线图
Keras 模型多输出 loss weight metrics 设置
力扣330 按要求补齐数组(贪心)
[7.29-8.5] Review of wonderful technical blog posts in the writing community
hdu1455 Sticks (search+pruning+pruning+.....+pruning)
Mysql8基础知识
Android development with Kotlin programming language - basic data types
How about Ping An Mengwa Card Insurance?Let parents read a few ways to identify products
如何用Golang来手写一个Blog - Milu.blog 开发总结
关注微信公众号,自动登陆网站
Four, kubeadm single master
安全软件Avast与赛门铁克诺顿NortonLifeLock合并获英国批准
Official release 2022 Nanjing Zhibo Expo is scheduled to be held in Xinzhuang National Exhibition in October
提问题进不去。想问大家一个关于返回值的问题(图的遍历),求给小白解答啊
Zhihu asks: Can China still achieve great national rejuvenation?
四、kubeadm单master
No developers, received a job to develop an IoT system, do you want to do it?
丹尼尔·拉瑞莫(BM):EOS的主要开发者
【HMS core】【FAQ】Health Kit、Ads kit、push Kit典型问题合集5