第一步查看mysql是否支持profile

select @@have_profiling
mysql性能分析profile
yes为支持

第二步查看profile是否开启

select @@profiling
mysql性能分析profile
0代表未开启,1代表已开启

如果查询显示0则需要开启
set @@profiling=1

第三步执行一sql语句

select * from person

第四步执行show profiles查看用时

show profiles
mysql性能分析profile
可以看到这条语句的用时

第五步根据上述Query_ID查看某一个线程的具体用时

show profile for query 101
show profile all for query 101 (可查看cpu用时)

mysql性能分析profile
mysql性能分析profile

相关文章:

  • 2020-05-26
  • 2021-09-09
  • 2021-09-09
  • 2021-01-21
  • 2021-11-07
  • 2021-11-02
  • 2021-08-15
猜你喜欢
  • 2021-08-30
  • 2021-09-09
  • 2021-09-09
  • 2021-08-30
  • 2021-08-30
  • 2021-08-30
  • 2021-08-30
  • 2021-08-30
相关资源
相似解决方案