mysql的sql性能分析器(2)
来源:未知 责任编辑:责任编辑 发表时间:2014-05-26 11:02 点击:次
mysql> show profiles;
+----------+------------+-------------------------------------+
| Query_ID | Duration | Query |
+----------+------------+-------------------------------------+
| 1 | 0.00382400 | select @@profiling |
| 2 | 0.00268500 | create table t5 as select * from t1 |
| 3 | 0.00017200 | SELECT DATABASE() |
| 4 | 0.01985400 | show databases |
| 5 | 0.00018900 | show tables |
| 6 | 0.06225200 | create table t5 as select * from t1 |
| 7 | 0.00368800 | select count(*) from t5 |
| 8 | 0.00322200 | select count(*) from t5 |
+----------+------------+-------------------------------------+
8 rows in set (0.01 sec)
mysql>
mysql> show profile for query 7;
+--------------------+----------+
| Status | Duration |
+--------------------+----------+
| (initialization) | 0.000414 |
| Opening tables | 0.000599 |
| System lock | 0.000254 |
| Table lock | 0.000175 |
| init | 0.000052 |
| optimizing | 0.00001 |
| executing | 0.002107 |
| end | 0.000042 |
| query end | 0.000005 |
| freeing items | 0.000014 |
| closing tables | 0.000011 |
| logging slow query | 0.000005 |
+--------------------+----------+
相关新闻>>
最新推荐更多>>>
- 发表评论
-
- 最新评论 更多>>