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

MySQL中如何使用profile分析SQL执行状态 - MySQL教程

发布时间:2014-12-04 23:21:56 所属栏目:MySql教程 来源:站长网
导读:打开profile mysql select @@have_profiling; +------------------+ | @@have_profiling | +------------------+ | YES | +------------------+ 1 row in set (0.00 sec) mysql select @@profiling; +-------------+ | @@profiling | +-------------+ | 0 | +

|        2 | 0.00008900 | select count(*) from payment        |

|        3 | 0.00006800 | show databaes                       |

|        4 | 0.02102800 | show databases                      |

|        5 | 0.02847600 | select count(*) from sakila.payment |

|        6 | 0.00006900 | select count(*) from sakila.payment |

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

6 rows in set (0.00 sec)

mysql> show profile for query 6;

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

| Status                         | Duration |

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

| starting                       | 0.000029 |

| Waiting for query cache lock   | 0.000004 |

| checking query cache for query | 0.000007 |

| checking privileges on cached  | 0.000004 |

| checking permissions           | 0.000008 |

| sending cached result to clien | 0.000012 |

| logging slow query             | 0.000002 |

| cleaning up                    | 0.000003 |

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

8 rows in set (0.00 sec)

(编辑:佛山站长网)

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

热点阅读