File: mysql_explain_log.1

package info (click to toggle)
mysql-dfsg-5.0 5.0.51a-24%2Blenny5
  • links: PTS, VCS
  • area: main
  • in suites: lenny
  • size: 106,168 kB
  • ctags: 94,516
  • sloc: cpp: 447,179; ansic: 411,410; perl: 38,307; sh: 37,449; tcl: 30,484; pascal: 14,851; yacc: 8,559; makefile: 5,078; java: 4,610; xml: 3,953; sql: 2,920; awk: 1,338; asm: 1,061; sed: 772
file content (110 lines) | stat: -rw-r--r-- 3,282 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
.\"     Title: \fBmysql_explain_log\fR
.\"    Author: 
.\" Generator: DocBook XSL Stylesheets v1.70.1 <http://docbook.sf.net/>
.\"      Date: 01/11/2008
.\"    Manual: MySQL Database System
.\"    Source: MySQL 5.0
.\"
.TH "\fBMYSQL_EXPLAIN_LOG" "1" "01/11/2008" "MySQL 5.0" "MySQL Database System"
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.SH "NAME"
mysql_explain_log \- use EXPLAIN on statements in query log
.SH "SYNOPSIS"
.HP 39
\fBmysql_explain_log [\fR\fB\fIoptions\fR\fR\fB] < \fR\fB\fIlog_file\fR\fR
.SH "DESCRIPTION"
.PP
\fBmysql_explain_log\fR
reads its standard input for query log contents. It uses
EXPLAIN
to analyze
SELECT
statements found in the input.
UPDATE
statements are rewritten to
SELECT
statements and also analyzed with
EXPLAIN.
\fBmysql_explain_log\fR
then displays a summary of its results.
.PP
The results may assist you in determining which queries result in table scans and where it would be beneficial to add indexes to your tables.
.PP
Invoke
\fBmysql_explain_log\fR
like this, where
\fIlog_file\fR
contains all or part of a MySQL query log:
.sp
.RS 3n
.nf
shell> \fBmysql_explain_log [\fR\fB\fIoptions\fR\fR\fB] < \fR\fB\fIlog_file\fR\fR
.fi
.RE
.PP
\fBmysql_explain_log\fR
understands the following options:
.TP 3n
\(bu
\fB\-\-help\fR,
\fB\-?\fR
.sp
Display a help message and exit.
.TP 3n
\(bu
\fB\-\-date=\fR\fB\fIYYMMDD\fR\fR,
\fB\-d \fR\fB\fIYYMMDD\fR\fR
.sp
Select entries from the log only for the given date.
.TP 3n
\(bu
\fB\-\-host=\fR\fB\fIhost_name\fR\fR,
\fB\-h \fR\fB\fIhost_name\fR\fR
.sp
Connect to the MySQL server on the given host.
.TP 3n
\(bu
\fB\-\-password=\fR\fB\fIpassword\fR\fR,
\fB\-p \fR\fB\fIpassword\fR\fR
.sp
The password to use when connecting to the server.
.sp
Specifying a password on the command line should be considered insecure. See
Section\ 5.6, \(lqKeeping Your Password Secure\(rq.
.TP 3n
\(bu
\fB\-\-printerror=1\fR,
\fB\-e 1\fR
.sp
Enable error output.
.TP 3n
\(bu
\fB\-\-socket=\fR\fB\fIpath\fR\fR,
\fB\-S \fR\fB\fIpath\fR\fR
.sp
For connections to
localhost, the Unix socket file to use, or, on Windows, the name of the named pipe to use.
.TP 3n
\(bu
\fB\-\-user=\fR\fB\fIuser_name\fR\fR,
\fB\-u \fR\fB\fIuser_name\fR\fR
.sp
The MySQL username to use when connecting to the server.
.SH "COPYRIGHT"
.PP
Copyright 2007\-2008 MySQL AB
.PP
This documentation is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License.
.PP
This documentation is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
.PP
You should have received a copy of the GNU General Public License along with the program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110\-1301 USA or see http://www.gnu.org/licenses/.
.SH "SEE ALSO"
For more information, please refer to the MySQL Reference Manual,
which may already be installed locally and which is also available
online at http://dev.mysql.com/doc/.
.SH AUTHOR
MySQL AB (http://www.mysql.com/).