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