• ADADADADAD

    如何进行性能分析profiling[ mysql数据库 ]

    mysql数据库 时间:2024-11-26 22:10:01

    作者:文/会员上传

    简介:

    使用mysql自带的工具profiling1.查看是否打开mysql> show variables like '%pro%';+---------------------------+-------+| Variable_name | Value |+------------

    以下为本文的正文内容,内容仅供参考!本站为公益性网站,复制本文以及下载DOC文档全部免费。

    使用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.默认是关闭的
    打开它
    setprofiling=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.docx

    将本文的Word文档下载到电脑

    推荐度:

    下载
    热门标签: profiling