1MK-MERGE-MQD-RESULTS(1)User Contributed Perl DocumentatioMnK-MERGE-MQD-RESULTS(1)
2
3
4
6 mk-merge-mqd-results - Merge multiple mk-query-digest reports into one.
7
9 mk-query-digest slow.log-1 --save-results res1.txt
10 mk-query-digest slow.log-2 --save-results res2.txt
11 mk-merge-mqd-results res1.txt res2.txt
12
14 The following section is included to inform users about the potential
15 risks, whether known or unknown, of using this tool. The two main
16 categories of risks are those created by the nature of the tool (e.g.
17 read-only tools vs. read-write tools) and those created by bugs.
18
19 At the time of this release, we know of no bugs that could cause
20 serious harm to users.
21
22 The authoritative source for updated information is always the online
23 issue tracking system. Issues that affect this tool will be marked as
24 such. You can see a list of such issues at the following URL:
25 http://www.maatkit.org/bugs/mk-merge-mqd-results
26 <http://www.maatkit.org/bugs/mk-merge-mqd-results>.
27
28 See also "BUGS" for more information on filing bugs and getting help.
29
31 This is a light-weight script for merging and reporting on results
32 saved by mk-query-digest --save-results.
33
35 --ask-pass
36 Prompt for a password when connecting to MySQL.
37
38 --charset
39 short form: -A; type: string
40
41 Default character set. If the value is utf8, sets Perl's binmode
42 on STDOUT to utf8, passes the mysql_enable_utf8 option to
43 DBD::mysql, and runs SET NAMES UTF8 after connecting to MySQL. Any
44 other value sets binmode on STDOUT without the utf8 layer, and runs
45 SET NAMES after connecting to MySQL.
46
47 --config
48 type: Array
49
50 Read this comma-separated list of config files; if specified, this
51 must be the first option on the command line.
52
53 --defaults-file
54 short form: -F; type: string
55
56 Only read mysql options from the given file. You must give an
57 absolute pathname.
58
59 --expected-range
60 type: array; default: 5,10
61
62 Explain items when there are more or fewer than expected.
63
64 Defines the number of items expected to be seen in the report as
65 controlled by "--limit" and "--outliers". If there are more or
66 fewer items in the report, each one will explain why it was
67 included.
68
69 --explain
70 type: DSN
71
72 Run EXPLAIN for the sample query with this DSN and print results.
73
74 This causes mk-merge-mqd-results to run EXPLAIN and include the
75 output into the report. For safety, queries that appear to have a
76 subquery that EXPLAIN will execute won't be EXPLAINed. Those are
77 typically "derived table" queries of the form
78
79 select ... from ( select .... ) der;
80
81 --fingerprints
82 Add query fingerprints to the standard query analysis report. This
83 is mostly useful for debugging purposes.
84
85 --[no]for-explain
86 default: yes
87
88 Print extra information to make analysis easy.
89
90 This option adds code snippets to make it easy to run SHOW CREATE
91 TABLE and SHOW TABLE STATUS for the query's tables. It also
92 rewrites non-SELECT queries into a SELECT that might be helpful for
93 determining the non-SELECT statement's index usage.
94
95 --help
96 Show help and exit.
97
98 --host
99 short form: -h; type: string
100
101 Connect to host.
102
103 --limit
104 type: string; default: 95%:20
105
106 Limit output to the given percentage or count.
107
108 If the argument is an integer, report only the top N worst queries.
109 If the argument is an integer followed by the "%" sign, report that
110 percentage of the worst queries. If the percentage is followed by
111 a colon and another integer, report the top percentage or the
112 number specified by that integer, whichever comes first.
113
114 See also "--outliers".
115
116 --order-by
117 type: string; default: Query_time:sum
118
119 Sort events by this attribute and aggregate function.
120
121 --outliers
122 type: string; default: Query_time:1:10
123
124 Report outliers by attribute:percentile:count.
125
126 The syntax of this option is a comma-separated list of colon-
127 delimited strings. The first field is the attribute by which an
128 outlier is defined. The second is a number that is compared to the
129 attribute's 95th percentile. The third is optional, and is
130 compared to the attribute's cnt aggregate. Queries that pass this
131 specification are added to the report, regardless of any limits you
132 specified in "--limit".
133
134 For example, to report queries whose 95th percentile Query_time is
135 at least 60 seconds and which are seen at least 5 times, use the
136 following argument:
137
138 --outliers Query_time:60:5
139
140 --password
141 short form: -p; type: string
142
143 Password to use when connecting.
144
145 --port
146 short form: -P; type: int
147
148 Port number to use for connection.
149
150 --report-format
151 type: Array; default:
152 rusage,date,files,header,profile,query_report,prepared
153
154 Print these sections of the query analysis report.
155
156 SECTION PRINTS
157 ============ ==============================================================
158 rusgae CPU times and memory usage reported by ps
159 date Current local date and time
160 files Input files read/parse
161 header Summary of the entire analysis run
162 profile Compact table of queries for an at-a-glance view of the report
163 query_report Detailed information about each unique query
164 prepared Prepared statements
165
166 The sections are printed in the order specified. The rusage, date,
167 files and header sections are grouped together if specified
168 together; other sections are separted by blank lines.
169
170 --report-histogram
171 type: string; default: Query_time
172
173 Chart the distribution of this attribute's values.
174
175 The distribution chart is limited to time-based attributes, so
176 charting "Rows_examined", for example, will produce a useless
177 chart.
178
179 --set-vars
180 type: string; default: wait_timeout=10000
181
182 Set these MySQL variables. Immediately after connecting to MySQL,
183 this string will be appended to SET and executed.
184
185 --shorten
186 type: int; default: 1024
187
188 Shorten long statements in reports.
189
190 Shortens long statements, replacing the omitted portion with a
191 "/*... omitted ...*/" comment. This applies only to the output in
192 reports, not to information stored other places. It prevents a
193 large statement from causing difficulty in a report. The argument
194 is the preferred length of the shortened statement. Not all
195 statements can be shortened, but very large INSERT and similar
196 statements often can; and so can IN() lists, although only the
197 first such list in the statement will be shortened.
198
199 If it shortens something beyond recognition, you can find the
200 original statement in the log, at the offset shown in the report
201 header.
202
203 --show-all
204 type: Hash
205
206 Show all values for these attributes.
207
208 By default mk-query-digest only shows as many of an attribute's
209 value that fit on a single line. This option allows you to specify
210 attributes for which all values will be shown (line width is
211 ignored). This only works for attributes with string values like
212 user, host, db, etc. Multiple attributes can be specified, comma-
213 separated.
214
215 --socket
216 short form: -S; type: string
217
218 Socket file to use for connection.
219
220 --user
221 short form: -u; type: string
222
223 User for login if not current user.
224
225 --version
226 Show version and exit.
227
228 --[no]zero-bool
229 default: yes
230
231 Print 0% boolean values in report.
232
234 These DSN options are used to create a DSN. Each option is given like
235 "option=value". The options are case-sensitive, so P and p are not the
236 same option. There cannot be whitespace before or after the "=" and if
237 the value contains whitespace it must be quoted. DSN options are
238 comma-separated. See the maatkit manpage for full details.
239
240 · A
241
242 dsn: charset; copy: yes
243
244 Default character set.
245
246 · D
247
248 dsn: database; copy: yes
249
250 Database that contains the query review table.
251
252 · F
253
254 dsn: mysql_read_default_file; copy: yes
255
256 Only read default options from the given file
257
258 · h
259
260 dsn: host; copy: yes
261
262 Connect to host.
263
264 · p
265
266 dsn: password; copy: yes
267
268 Password to use when connecting.
269
270 · P
271
272 dsn: port; copy: yes
273
274 Port number to use for connection.
275
276 · S
277
278 dsn: mysql_socket; copy: yes
279
280 Socket file to use for connection.
281
282 · t
283
284 Table to use as the query review table.
285
286 · u
287
288 dsn: user; copy: yes
289
290 User for login if not current user.
291
293 You can download Maatkit from Google Code at
294 <http://code.google.com/p/maatkit/>, or you can get any of the tools
295 easily with a command like the following:
296
297 wget http://www.maatkit.org/get/toolname
298 or
299 wget http://www.maatkit.org/trunk/toolname
300
301 Where "toolname" can be replaced with the name (or fragment of a name)
302 of any of the Maatkit tools. Once downloaded, they're ready to run; no
303 installation is needed. The first URL gets the latest released version
304 of the tool, and the second gets the latest trunk code from Subversion.
305
307 The environment variable "MKDEBUG" enables verbose debugging output in
308 all of the Maatkit tools:
309
310 MKDEBUG=1 mk-....
311
313 You need Perl and some core packages that ought to be installed in any
314 reasonably new version of Perl.
315
317 For list of known bugs see
318 http://www.maatkit.org/bugs/mk-merge-mqd-results
319 <http://www.maatkit.org/bugs/mk-merge-mqd-results>.
320
321 Please use Google Code Issues and Groups to report bugs or request
322 support: <http://code.google.com/p/maatkit/>. You can also join
323 #maatkit on Freenode to discuss Maatkit.
324
325 Please include the complete command-line used to reproduce the problem
326 you are seeing, the version of all MySQL servers involved, the complete
327 output of the tool when run with "--version", and if possible,
328 debugging output produced by running with the "MKDEBUG=1" environment
329 variable.
330
332 This program is copyright 2010 Percona Inc. Feedback and improvements
333 are welcome.
334
335 THIS PROGRAM IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED
336 WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
337 MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
338
339 This program is free software; you can redistribute it and/or modify it
340 under the terms of the GNU General Public License as published by the
341 Free Software Foundation, version 2; OR the Perl Artistic License. On
342 UNIX and similar systems, you can issue `man perlgpl' or `man
343 perlartistic' to read these licenses.
344
345 You should have received a copy of the GNU General Public License along
346 with this program; if not, write to the Free Software Foundation, Inc.,
347 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
348
350 Daniel Nichter
351
353 This manual page documents Ver 0.9.20 Distrib 6839 $Revision: 6831 $.
354
355
356
357perl v5.12.1 2010-08-01 MK-MERGE-MQD-RESULTS(1)