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

如何进行功能分析profiling

发布时间:2021-12-18 13:45:57 所属栏目: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

(编辑:ASP站长)

【免责声明】本站内容转载自互联网,其相关言论仅代表作者个人观点绝非权威,不代表本站立场。如您发现内容存在版权问题,请提交相关链接至邮箱:bqsm@foxmail.com,我们将及时予以处理。

    相关内容
    未处理完善
      无相关信息
    未处理完善