当前位置:网站首页>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万条数据。然后对他进行排序。
边栏推荐
- SSM integration
- 并发编程学习笔记 之 Lock锁及其实现类ReentrantLock、ReentrantReadWriteLock和StampedLock的基本用法
- “山东大学移动互联网开发技术教学网站建设”项目实训日志二
- Windows下cmd窗口连接mysql并操作表
- 与张小姐的春夏秋冬(1)
- Crypto巨头们ALL IN元宇宙,PlatoFarm或能突围
- 30 knowledge points that must be mastered in quantitative development [what is individual data]?
- Reporting Services- Web Service
- 【数据库】数据库课程设计一一疫苗接种数据库
- How to survive in the bear market of encryption market?
猜你喜欢
Ribbon学习笔记一
Dao race track is booming. What are the advantages of m-dao?
C# 连接 SharepointOnline WebService
XDFS&空天院HPC集群典型案例
Flink connector Oracle CDC 实时同步数据到MySQL(Oracle19c)
一文读懂Move2Earn项目——MOVE
与张小姐的春夏秋冬(2)
闪贷Dapp的调研及实现
量化开发必掌握的30个知识点【什么是分笔逐笔数据】?
Training log 4 of the project "construction of Shandong University mobile Internet development technology teaching website"
随机推荐
“山东大学移动互联网开发技术教学网站建设”项目实训日志四
Bare metal cloud FASS high performance elastic block storage solution
Go|gin quickly use swagger
极致通缩和永动机模型,将推动 PlatoFarm 爆发
Refresh, swagger UI theme changes
全闪分布式,如何深度性能POC?
Plato Farm有望通过Elephant Swap,进一步向外拓展生态
量化开发必掌握的30个知识点【什么是分笔逐笔数据】?
量化开发必掌握的30个知识点【什么是Level-2数据】
NIFI 改UTC时间为CST时间
学习、研究编程之道
DeFi 2.0的LaaS协议,重振DeFi赛道发展的关键
Mobile terminal -flex item attribute
Move protocol global health declaration, carry out the health campaign to the end
Under the bear market of encrypted assets, platofarm's strategy can still obtain stable income
Win10+opencv3.2+vs2015 configuration
30 knowledge points that must be mastered in quantitative development [what is level-2 data]
How to survive in the bear market of encryption market?
『全闪实测』数据库加速解决方案
Power BI Report Server 自定义身份验证