当前位置:网站首页>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万条数据。然后对他进行排序。
边栏推荐
- MySql统计函数COUNT详解
- xtrabackup 的使用
- Move protocol global health declaration, carry out the health campaign to the end
- 【go】defer的使用
- 识变!应变!求变!
- Gluster集群管理小分析
- Fantom (FTM) surged 45% before the FOMC meeting
- 一文读懂Move2Earn项目——MOVE
- 重庆大道云行作为软件产业代表受邀参加渝中区重点项目签约仪式
- Under the bear market of encrypted assets, platofarm's strategy can still obtain stable income
猜你喜欢

从Starfish OS持续对SFO的通缩消耗,长远看SFO的价值

剑指核心-TaoCloud全闪SDS助力构建高性能云服务

全闪分布式,如何深度性能POC?

Machine learning makes character recognition easier: kotlin+mvvm+ Huawei ml Kit

day02作业之进程管理

File permissions of day02 operation

XDFS&空天院HPC集群典型案例

Super simple integration HMS ml kit face detection to achieve cute stickers

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

Starfish OS:以现实为纽带,打造元宇宙新范式
随机推荐
Training log III of "Shandong University mobile Internet development technology teaching website construction" project
初探fastJson的AutoType
Huawei 2020 school recruitment written test programming questions read this article is enough (Part 1)
Gluster集群管理小分析
DeFi 2.0的LaaS协议,重振DeFi赛道发展的关键
Countdown of the uniapp component (such as the countdown to reading the agreement and the countdown to completing learning)
How to survive in the bear market of encryption market?
Ribbon学习笔记一
Shanzhai coin Shib has a US $548.6 million stake in eth whale's portfolio - traders should be on guard
与张小姐的春夏秋冬(4)
From starfish OS' continued deflationary consumption of SFO, the value of SFO in the long run
在uni-app项目中,如何实现微信小程序openid的获取
与张小姐的春夏秋冬(5)
与张小姐的春夏秋冬(3)
性能对比|FASS iSCSI vs NVMe/TCP
Training log 7 of the project "construction of Shandong University mobile Internet development technology teaching website"
How to make interesting apps for deep learning with zero code (suitable for novices)
datax安装
微信内置浏览器禁止缓存的问题
从Starfish OS持续对SFO的通缩消耗,长远看SFO的价值