加入收藏 | 设为首页 | 会员中心 | 我要投稿 济南站长网 (https://www.0531zz.com/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 站长学院 > MySql教程 > 正文

MySQL中怎样行使profile说明SQL执行状态

发布时间:2016-10-29 16:42:20 所属栏目:MySql教程 来源:站长网
导读:副标题#e# 打开 profile mysql select @@have_profiling; +------------------+ | @@have_profiling | +------------------+ | YES | +------------------+ 1 row in set (0.00 sec) mysql select @@profiling; +-------------+ | @@profiling | +---------

mysql> show profile for query 24;

+--------------------------------+----------+

| Status                         | Duration |

+--------------------------------+----------+

| starting                       | 0.000026 |

| Waiting for query cache lock   | 0.000003 |

| checking query cache for query | 0.000037 |

| checking permissions           | 0.000006 |

| Opening tables                 | 0.000015 |

| System lock                    | 0.000009 |

| Waiting for query cache lock   | 0.000019 |

| init                           | 0.000011 |

| optimizing                     | 0.000006 |

| executing                      | 0.000006 |

| end                            | 0.000000 |

| query end                      | 0.000001 |

| closing tables                 | 0.000008 |

| freeing items                  | 0.000019 |

| Waiting for query cache lock   | 0.000008 |

| freeing items                  | 0.000013 |

| Waiting for query cache lock   | 0.000008 |

| freeing items                  | 0.000008 |

| storing result in query cache  | 0.000015 |

| logging slow query             | 0.000008 |

| cleaning up                    | 0.000009 |

+--------------------------------+----------+

可以看到在count操作MyISAM表时没有sending data这个状态,和Innodb不同,,MyISAM不需要访问表数据,所以count操作比Innodb快。

本栏目更多精彩内容:http://www.bianceng.cn/database/MySQL/

(编辑:济南站长网)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

热点阅读