1MYSQLDUMPSLOW(1) MySQL Database System MYSQLDUMPSLOW(1)
2
3
4
6 mysqldumpslow - Summarize slow query log files
7
9 mysqldumpslow [options] [log_file ...]
10
12 The MySQL slow query log contains information about queries that take a
13 long time to execute (see Section 5.2.5, “The Slow Query Log”).
14 mysqldumpslow parses MySQL slow query log files and prints a summary of
15 their contents.
16
17 Normally, mysqldumpslow groups queries that are similar except for the
18 particular values of number and string data values. It “abstracts”
19 these values to N and ´S´ when displaying summary output. The -a and -n
20 options can be used to modify value abstracting behavior.
21
22 Invoke mysqldumpslow like this:
23
24 shell> mysqldumpslow [options] [log_file ...]
25
26 mysqldumpslow supports the following options.
27
28 · --help
29
30 Display a help message and exit.
31
32 · -a
33
34 Do not abstract all numbers to N and strings to ´S´.
35
36 · --debug, -d
37
38 Run in debug mode.
39
40 · -g pattern
41
42 Consider only queries that match the (grep-style) pattern.
43
44 · -h host_name
45
46 Host name of MySQL server for *-slow.log file name. The value can
47 contain a wildcare. The default is * (match all).
48
49 · -i name
50
51 Name of server instance (if using mysql.server startup script).
52
53 · -l
54
55 Do not subtract lock time from total time.
56
57 · -n N
58
59 Abstract numbers with at least N digits within names.
60
61 · -r
62
63 Reverse the sort order.
64
65 · -s sort_type
66
67 How to sort the output. The value of sort_type should be chosen
68 from the following list:
69
70 · t, at: Sort by query time or average query time
71
72 · l, al: Sort by lock time or average lock time
73
74 · s, as: Sort by rows sent or average rows sent
75
76 · c: Sort by count
77
78 · -t N
79
80 Display only the first N queries in the output.
81
82 · --verbose, -v
83
84 Verbose mode. Print more information about what the program does.
85
86 Example of usage:
87
88 shell> mysqldumpslow
89 Reading mysql slow query log from /usr/local/mysql/data/mysqld51-apple-slow.log
90 Count: 1 Time=4.32s (4s) Lock=0.00s (0s) Rows=0.0 (0), root[root]@localhost
91 insert into t2 select * from t1
92 Count: 3 Time=2.53s (7s) Lock=0.00s (0s) Rows=0.0 (0), root[root]@localhost
93 insert into t2 select * from t1 limit N
94 Count: 3 Time=2.13s (6s) Lock=0.00s (0s) Rows=0.0 (0), root[root]@localhost
95 insert into t1 select * from t1
96
98 Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc.
99
100 This documentation is free software; you can redistribute it and/or
101 modify it only under the terms of the GNU General Public License as
102 published by the Free Software Foundation; version 2 of the License.
103
104 This documentation is distributed in the hope that it will be useful,
105 but WITHOUT ANY WARRANTY; without even the implied warranty of
106 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
107 General Public License for more details.
108
109 You should have received a copy of the GNU General Public License along
110 with the program; if not, write to the Free Software Foundation, Inc.,
111 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or see
112 http://www.gnu.org/licenses/.
113
114
116 For more information, please refer to the MySQL Reference Manual, which
117 may already be installed locally and which is also available online at
118 http://dev.mysql.com/doc/.
119
121 Sun Microsystems, Inc. (http://www.mysql.com/).
122
123
124
125MySQL 5.1 04/06/2010 MYSQLDUMPSLOW(1)