O'Reilly logo

MySQL in a Nutshell by Russell J.T. Dyer

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Name

mysqldumpslow

Synopsis

mysqldumpslow [options] [filename]

Use this to display a summary of the slow query log. The path and name of the logfile may be given in the second argument. Otherwise, the utility will look to the server’s configuration file (i.e., my.cnf) for this information. The following options can narrow the summary or change what is displayed.

-a

Instructs the utility not to combine queries with similar SQL statements.

-d

Enables debugging mode.

-g expression

Extracts information on queries that meet the given expression.

-h host

Specifies the host’s name for which the utility is to scan. By default, logfiles are named with the server’s hostname as the filename’s prefix.

-i host

Specifies the hostname of the server.

-l

With this option, the lock time is added to the execution time for the utility’s summary.

-n number

Sets the minimum number of occurrences for reporting.

-r

Reverses the order of sorts for reporting.

-s type

Specifies the type of queries on which to report. The choices are al for average lock time, ar for average rows, at for average execution time, l for lock time, r for rows, and t for execution time.

-t

Sets the number of queries on which to display.

-v

Displays more information.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required