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

如何进行功能分析profiling

发布时间:2021-12-18 13:56:51 所属栏目:MySql教程 来源:互联网
导读:如何进行性能分析profiling,相信很多没有经验的人对此束手无策,为此本文总结了问题出现的原因和解决方法,通过这篇文章希望你能解决这个问题。 使用mysql自带的工具profiling 1.查看是否打开 mysql show variables like %pro%; +--------------------------
如何进行性能分析profiling,相信很多没有经验的人对此束手无策,为此本文总结了问题出现的原因和解决方法,通过这篇文章希望你能解决这个问题。
 
使用mysql自带的工具profiling
 
1.查看是否打开
mysql> show variables like '%pro%';
+---------------------------+-------+
| Variable_name             | Value |
+---------------------------+-------+
| have_profiling            | YES   |
| profiling                 | OFF   |
| profiling_history_size    | 15    |
| protocol_version          | 10    |
| proxy_user                |       |
| slave_compressed_protocol | OFF   |
| stored_program_cache      | 256   |
+---------------------------+-------+
7 rows in set (0.00 sec)
 
2.默认是关闭的
打开它
set profiling=1;
 
3.使用
 select * from corp_base_par where res_date=330000 limit 1;
 
mysql> show profiles;
+----------+------------+-----------------------------------------------------------+
| Query_ID | Duration   | Query                                                     |
+----------+------------+-----------------------------------------------------------+
|        1 | 0.00008975 | set  profiling=1                                          |
|        2 | 0.00088450 | select * from corp_base_par where res_date=330000 limit 1 |
+----------+------------+-----------------------------------------------------------+
2 rows in set (0.00 sec)
 
显示了 这条sql的具体消耗时间
 
 
看完上述内容,你们掌握如何进行性能分析profiling的方法了吗?如果还想学到更多技能或想了解更多相关内容,欢迎关注亿速云行业资讯频道,感谢各位的阅读!
如何进行功能分析profiling

(编辑:52站长网)

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

    热点阅读