Show profiles是5.0.37之后添加的,要想使用此功能,要确保版本在5.0.37之后。

查看一下我的数据库版本

show profiles 使用分析sql性能

版本是支持show profiles功能的。接下来进入mysql性能跟踪诊断的世界

查看是否打开了profiles功能,默认是关闭的

show profiles 使用分析sql性能

显示为空,说明profiles功能是关闭的。下面开启

show profiles 使用分析sql性能

执行几行查询,然后执行show profiles

show profiles 使用分析sql性能

可以看到命令执行时间,根据query_id 查看某个查询的详细时间耗费

show profiles 使用分析sql性能

还可以查看占用cpu、 io等信息

show profiles 使用分析sql性能

 

转载于:https://my.oschina.net/jzgycq/blog/1595465

相关文章:

  • 2021-11-17
  • 2021-09-23
  • 2021-04-05
  • 2021-06-18
  • 2021-11-19
  • 2021-07-30
  • 2021-09-09
  • 2022-01-08
猜你喜欢
  • 2022-01-02
  • 2021-07-04
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案