1、mysql用来分析当前会话中执行的资源消耗情况,可用于SQL的调优测量。

2、默认情况下是关闭的,并保存最近15次的运行结果

3、分析步骤
(1)查看mysql版本是否支持 show variables like 'profiling', 若开启执行 set profiling=on
(2)查看结果:show profiles;
Show profile
(3) 诊断sql,show profile cpu,block io for query 24 #Query_ID,主要出现问题如下:

  • converting HEAP to MyISAM 查询结果太大,内存不够了往磁盘上搬了
  • creating tmp table 创建临时表:(1)拷贝数据到临时表。(2)用完再删。
  • copying to tmp table on disk 把内存中临时表复制到磁盘,危险!!!
  • locked
    Show profile

相关文章:

  • 2022-12-23
  • 2021-09-23
  • 2021-07-30
  • 2021-10-15
  • 2021-12-16
  • 2021-07-05
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-04-28
  • 2021-05-13
  • 2021-12-26
  • 2021-10-13
  • 2022-12-23
  • 2021-08-26
相关资源
相似解决方案