mysql command line return execution time?

前端 未结 3 1661
陌清茗
陌清茗 2021-02-07 05:45

I\'m working on a Linux host with mysql command. I have a script that runs batch mysql commands (like mysql -e \"select...\") and I wish to summarize execution time

3条回答
  •  说谎
    说谎 (楼主)
    2021-02-07 06:42

    You can use

    set profiling=1
    

    and then, later,

    show profiles
    

    which will give a list of commands and times.

    See http://dev.mysql.com/doc/refman/5.0/en/show-profiles.html

    h/t http://ronaldbradford.com/blog/timing-your-sql-queries-2010-07-07/

提交回复
热议问题