当前位置:网站首页>mysql 的show profiles 使用。
mysql 的show profiles 使用。
2022-07-29 05:20:00 【麻辣隔壁4】
为了分析sql的执行耗时以及性能。我们可以使用show profiles 进行分析。
首先查看是否开启:
show VARIABLES like "profiling"如果开启它的值会是ON.如果没有开启则使用下面语句开启。
set profiling='on'查询最近语句的执行情况:
SHOW PROFILES执行的结果为:

可以看到query_id为127的执行用了1.12秒。那么是什么导致它执行慢可以用以下语句进行查询
SHOW PROFILE cpu,block io for query 127执行的结果为:

可以看到这条语句在执行的时候耗费了大量的时间。 因为数据库有50万条数据。然后对他进行排序。
边栏推荐
- asyncawait和promise的区别
- 运动健康深入人心,MOVE PROTOCOL引领品质生活
- Differences between href and SRC
- 一文读懂Move2Earn项目——MOVE
- Power BI Report Server 自定义身份验证
- 初探fastJson的AutoType
- 超简单集成HMS ML Kit 人脸检测实现可爱贴纸
- Okaleido tiger logged into binance NFT on July 27, and has achieved good results in the first round
- 以‘智’提‘质|金融影像平台解决方案
- Extreme deflation and perpetual motion machine model will promote the outbreak of platofarm
猜你喜欢

Thinkphp6 output QR code image format to solve the conflict with debug

Markdown语法

Reporting Services- Web Service

Reporting Service 2016 自定义身份验证

Android Studio 实现登录注册-源代码 (连接MySql数据库)

Simple optimization of interesting apps for deep learning (suitable for novices)

【数据库】数据库课程设计一一疫苗接种数据库

突破硬件瓶颈(一):Intel体系架构的发展与瓶颈挖掘

机器学习让文字识别更简单:Kotlin+MVVM+华为ML Kit

Super simple integration of HMS ml kit to realize parent control
随机推荐
Go|gin quickly use swagger
How to make interesting apps for deep learning with zero code (suitable for novices)
与张小姐的春夏秋冬(4)
day02 作业之文件权限
Shanzhai coin Shib has a US $548.6 million stake in eth whale's portfolio - traders should be on guard
一文读懂Move2Earn项目——MOVE
Fantom (FTM) prices will soar by 20% in the next few days
Performance comparison | FASS iSCSI vs nvme/tcp
DeFi 2.0的LaaS协议,重振DeFi赛道发展的关键
性能对比|FASS iSCSI vs NVMe/TCP
“山东大学移动互联网开发技术教学网站建设”项目实训日志三
“山东大学移动互联网开发技术教学网站建设”项目实训日志五
Elastic box flex
Dao race track is booming. What are the advantages of m-dao?
机器学习让文字识别更简单:Kotlin+MVVM+华为ML Kit
完全去中心化的编程模式,不需要服务器,也不需要ip,就像一张漫无目的的网络、四处延伸
File文件上传的使用(2)--上传到阿里云Oss文件服务器
Get the number of daffodils
Ribbon学习笔记二
从Starfish OS持续对SFO的通缩消耗,长远看SFO的价值