Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 380eaaa

Browse files
author
Thomas G. Lockhart
committed
Add a few words from Vadim and an example on explain output.
Update the update date.
1 parent 0f57641 commit 380eaaa

File tree

1 file changed

+46
-2
lines changed

1 file changed

+46
-2
lines changed

src/man/explain.l

+46-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
.\" This is -*-nroff-*-
22
.\" XXX standard disclaimer belongs here....
3-
.\" $Header: /cvsroot/pgsql/src/man/Attic/explain.l,v 1.4 1997/01/16 14:56:59 momjian Exp $
4-
.TH EXPLAIN SQL 11/05/95 PostgreSQL PostgreSQL
3+
.\" $Header: /cvsroot/pgsql/src/man/Attic/explain.l,v 1.5 1997/06/12 23:45:54 thomas Exp $
4+
.TH EXPLAIN SQL 06/12/97 PostgreSQL PostgreSQL
55
.SH NAME
66
explain \(em explains statement execution details
77
.SH SYNOPSIS
@@ -12,6 +12,50 @@ explain \(em explains statement execution details
1212
This command outputs details about the supplied query. The default
1313
output is the computed query cost. \f2verbose\f1 displays the full query
1414
plan and cost.
15+
16+
.SH EXAMPLES
17+
In the examples, the table has a single column of float4.
18+
\fBcost\fR is the cost of scanning a base/join relation,
19+
\fBsize\fR is the expected number of tuples from a scan,
20+
\fBwidth\fR is the length of a tuple.
21+
22+
.nf
23+
tgl=> explain select a from test\g
24+
NOTICE:QUERY PLAN:
25+
26+
Seq Scan on test (cost=0.00 size=0 width=4)
27+
28+
EXPLAIN
29+
tgl=> explain verbose select sum(a) from test;
30+
NOTICE:QUERY PLAN:
31+
32+
{AGG :cost 0 :size 0 :width 0 :state nil :qptargetlist
33+
({TLE :resdom {RESDOM :resno 1 :restype 700 :reslen 4 :resname "sum"
34+
:reskey 0 :reskeyop 0 :resjunk 0}
35+
:expr {AGGREG :aggname "sum" :basetype 700 :aggtype 700 :aggno 0
36+
:target {VAR :varno 1 :varattno 1 :vartype 700 :varnoold 1 :varoattno 1}}})
37+
:qpqual nil :lefttree {SEQSCAN :cost 0 :size 0 :width 4 :state nil
38+
:qptargetlist ({TLE :resdom {RESDOM :resno 1 :restype 700 :reslen 4
39+
:resname "null" :reskey 0 :reskeyop 0 :resjunk 0}
40+
:expr {VAR :varno 1 :varattno 1 :vartype 700 :varnoold 1 :varoattno 1}})
41+
:qpqual nil :lefttree nil :righttree nil :scanrelid 1} :righttree nil :numagg 1 }
42+
43+
Aggregate (cost=0.00 size=0 width=0)
44+
-> Seq Scan on test (cost=0.00 size=0 width=4)
45+
.fi
46+
47+
The Postgres optimizer has chosen to use a sequential scan to retrieve rows from
48+
this table. Indices will used by the optimizer
49+
after tables grow large enough to warrant the access
50+
overhead; typically this might happen when tables have a few hundred rows.
51+
52+
.SH "SEE ALSO"
53+
delete(l),
54+
insert(l),
55+
select(l).
56+
57+
.SH BUGS
58+
1559
.PP
1660
The query cost and plan can be affected by running vacuum.
1761

0 commit comments

Comments
 (0)