zl程序教程

您现在的位置是:首页 >  其它

当前栏目

mysqldumpslow

2023-09-11 14:16:16 时间

  

 

  1. -s 依据什么排序
    al  average lock time
    ar  average rows sent
    at  average query time
    c  count
    l  lock time
    r rows sent
    t query time


  2. -t show top N queries


  3. -g grep: only consider stmts that include this string

 

Examples:

  1. 得到返回记录集最多的10个SQL
    mysqldumpslow -s r -t 10 hostname-slow.log

     

  2. 得到访问次数最多的10个SQL
    mysqldumpslow -s c -t 10 hostname-slow.log

     

  3. 按时间排序的前10SQL中含有'left join'的
    mysqldumpslow  -s t -t 10 -g 'left join' hostname-slow.log