zoukankan      html  css  js  c++  java
  • mysql sql语句执行时间查询

    第一种:

    开启profile

    1
    2
    mysql> set profiling=1;
    Query OK, 0 rows affected (0.00 sec)

    eg:

    1
    2
    3
    4
    5
    6
    7
    8
    mysql> select * from test_1;
    mysql> show profiles;
    +----------+------------+----------------------+
    | Query_ID | Duration   | Query                |
    +----------+------------+----------------------+
    |        1 | 0.84718100 | select * from test_1 |
    +----------+------------+----------------------+
    1 row in set (0.00 sec)

    第二种:(通过时间差查看)

    delimiter // set @d=now();
    select * from comment;
    select timestampdiff(second,@d,now());
    delimiter ;
    
    
    Query OK, 0 rows affected (1 min 55.58 sec)
    
    
    +----------------------------------+
    | timestampdiff(second, @d, now()) |
    +----------------------------------+
    |                                2 |
    +----------------------------------+
    1 row in set (1 min 55.58 sec) 
  • 相关阅读:
    SpringBoot04-web
    springboot03-日志功能
    SpringBoot02-自动配置原理
    SpringBoot02
    SpringBoot01
    八大排序算法
    SpringSecurity04
    SpringSecurity03
    SpringSecurity02
    SpringSecurity01
  • 原文地址:https://www.cnblogs.com/qiandu/p/4135404.html
Copyright © 2011-2022 走看看