加入收藏 | 设为首页 | 会员中心 | 我要投稿 银川站长网 (https://www.0951zz.com/)- 云通信、基础存储、云上网络、机器学习、视觉智能!
当前位置: 首页 > 站长学院 > MySql教程 > 正文

如何实行性能分析profiling

发布时间:2023-07-27 12:44:26 所属栏目:MySql教程 来源:
导读:如何进行性能分析profiling,相信很多没有经验的人对此束手无策,为此本文总结了问题出现的原因和解决方法,通过这篇文章希望你能解决这个问题。使用mysql自带的工具profiling1.查看是否打开mysql> show variables l

如何进行性能分析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的方法了吗?

(编辑:银川站长网)

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

    推荐文章