Friday 14 June 2013

command mysqldumpslow


mysqldumpslow

syntax: 
mysqldumpslow <mysql_slow_log_file>

mysqldumpslow -s at <mysql_slow_log_file>

Count: 438  Time=5.80s (2540s)  Lock=0.00s (0s)  Rows=4331.9 (1897393), moviesfe[moviesfe]@4hosts

Notes on mysqldumpslow:
NOTE: -s t [ t for count => sort on hight count of a same query ]
NOTE: -s at [ at for time => sort on hight time take query ]
NOTE: -s l [ sort bashed on the query those lock the table ]
NOTE: -s al [ Sort on lock and large query size -> do a recheck, might be large query size ]
NOTE: -s r [ bashw=ed on row]

is in order:
t=count, at=time, l=lock, al=rows, r=

$mysqldumpslow --help
Usage: mysqldumpslow [ OPTS... ] [ LOGS... ]

Parse and summarize the MySQL slow query log. Options are

  --verbose    verbose
  --debug      debug
  --help       write this text to standard output

  -v           verbose
  -d           debug
  -s ORDER     what to sort by (t, at, l, al, r, ar etc), 'at' is default
  -r           reverse the sort order (largest last instead of first)
  -t NUM       just show the top n queries
  -a           don't abstract all numbers to N and strings to 'S'
  -n NUM       abstract numbers with at least n digits within names
  -g PATTERN   grep: only consider stmts that include this string
  -h HOSTNAME  hostname of db server for *-slow.log filename (can be wildcard),
               default is '*', i.e. match all
  -i NAME      name of server instance (if using mysql.server startup script)
  -l           don't subtract lock time from total time

No comments:

Post a Comment