mysql的sql性能分析器(3)

来源:未知 责任编辑:责任编辑 发表时间:2014-05-26 11:02 点击:

12 rows in set (0.03 sec)
 
mysql> show profile for query 8;
+--------------------+----------+
| Status             | Duration |
+--------------------+----------+
| (initialization)   | 0.000064 |
| Opening tables     | 0.000018 |
| System lock        | 0.00001  |
| Table lock         | 0.000013 |
| init               | 0.00002  |
| optimizing         | 0.00001  |
| executing          | 0.002589 |
| end                | 0.000459 |
| query end          | 0.000007 |
| freeing items      | 0.000015 |
| closing tables     | 0.000012 |
| logging slow query | 0.000005 |
+--------------------+----------+
12 rows in set (0.00 sec)
 
mysql> select sum(format(duration,6)) as duration from information_schema.profiling where query_id=7;
+----------+
| duration |
+----------+
| 0.003688 |
+----------+
1 row in set (0.02 sec)
 
mysql> select sum(format(duration,6)) as duration from information_schema.profiling where query_id=8;
+----------+
| duration |
+----------+
| 0.003222 |
+----------+
1 row in set (0.00 sec)
 
mysql>
 
从如上的信息可以看出这两个sql的profile统计信息里,前4项差别比较大,这是两个sql主要区别,第二次查询有很多
缓存了了。SQL 性能分析器可以帮助我们对一些比较难以确定性能问题的SQL 进行诊断,找出问题根源。
 
 
------end-----
发表评论
请自觉遵守互联网相关的政策法规,严禁发布色情、暴力、反动的言论。
用户名: 验证码:点击我更换图片
最新评论 更多>>

推荐热点

  • mysql-mmm
  • mysqldump命令——MySQL数据库备份还原
  • Oracle数据导入MySQL的快捷工具:MySQL Migration Toolkit
  • 简简单单储存过程——循环一个select结果集
  • MySQL数据库十大优化技巧
  • Mysql主主复制架构配置
  • Mysql安装笔记
  • MySQL Stmt预处理提高效率问题的小研究
  • Mysql的Procedure 参数为NULL问题分析
网站首页 - 友情链接 - 网站地图 - TAG标签 - RSS订阅 - 内容搜索
Copyright © 2008-2015 计算机技术学习交流网. 版权所有

豫ICP备11007008号-1