2
3
4
6 mysql_explain_log - use EXPLAIN on statements in query log
7
9 mysql_explain_log [options] < log_file
10
12 mysql_explain_log reads its standard input for query log contents. It
13 uses EXPLAIN to analyze SELECT statements found in the input. UPDATE
14 statements are rewritten to SELECT statements and also analyzed with
15 EXPLAIN. mysql_explain_log then displays a summary of its results.
16
17 The results may assist you in determining which queries result in table
18 scans and where it would be beneficial to add indexes to your tables.
19
20 Invoke mysql_explain_log like this, where log_file contains all or part
21 of a MySQL query log:
22
23 shell> mysql_explain_log [options] < log_file
24
25 mysql_explain_log understands the following options:
26
27 · --help, -?
28
29 Display a help message and exit.
30
31 · --date=YYMMDD, -d YYMMDD
32
33 Select entries from the log only for the given date.
34
35 · --host=host_name, -h host_name
36
37 Connect to the MySQL server on the given host.
38
39 · --password=password, -p password
40
41 The password to use when connecting to the server.
42
43 Specifying a password on the command line should be considered
44 insecure. See Section 6.6, “Keeping Your Password Secure”.
45
46 · --printerror=1, -e 1
47
48 Enable error output.
49
50 · --socket=path, -S path
51
52 For connections to localhost, the Unix socket file to use, or, on
53 Windows, the name of the named pipe to use.
54
55 · --user=user_name, -u user_name
56
57 The MySQL username to use when connecting to the server.
58
60 Copyright 1997-2007 MySQL AB
61
62 This documentation is NOT distributed under a GPL license. Use of this
63 documentation is subject to the following terms: You may create a
64 printed copy of this documentation solely for your own personal use.
65 Conversion to other formats is allowed as long as the actual content is
66 not altered or edited in any way. You shall not publish or distribute
67 this documentation in any form or on any media, except if you
68 distribute the documentation in a manner similar to how MySQL
69 disseminates it (that is, electronically for download on a Web site
70 with the software) or on a CD-ROM or similar medium, provided however
71 that the documentation is disseminated together with the software on
72 the same medium. Any other use, such as any dissemination of printed
73 copies or use of this documentation, in whole or in part, in another
74 publication, requires the prior written consent from an authorized
75 representative of MySQL AB. MySQL AB reserves any and all rights to
76 this documentation not expressly granted above.
77
78 Please email <docs@mysql.com> for more information.
79
81 For more information, please refer to the MySQL Reference Manual, which
82 may already be installed locally and which is also available online at
83 http://dev.mysql.com/doc/.
84
86 MySQL AB (http://www.mysql.com/). This software comes with no
87 warranty.
88
89
90