Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
765dd2a4
Commit
765dd2a4
authored
Dec 29, 1996
by
Bruce Momjian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
explain change
parent
bf6fdeeb
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
13 deletions
+23
-13
src/backend/commands/explain.c
src/backend/commands/explain.c
+14
-7
src/bin/psql/psqlHelp.h
src/bin/psql/psqlHelp.h
+2
-2
src/man/explain.l
src/man/explain.l
+7
-4
No files found.
src/backend/commands/explain.c
View file @
765dd2a4
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/commands/explain.c,v 1.
6 1996/12/29 00:53:20
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/commands/explain.c,v 1.
7 1996/12/29 19:30:55
momjian Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -27,8 +27,8 @@
...
@@ -27,8 +27,8 @@
typedef
struct
ExplainState
{
typedef
struct
ExplainState
{
/* options */
/* options */
int
printCost
;
/* print cost */
bool
printCost
;
/* print cost */
int
printNodes
;
/* do nodeToString() instead */
bool
printNodes
;
/* do nodeToString() instead */
/* other states */
/* other states */
List
*
rtable
;
/* range table */
List
*
rtable
;
/* range table */
}
ExplainState
;
}
ExplainState
;
...
@@ -69,18 +69,25 @@ ExplainQuery(Query *query, List *options, CommandDest dest)
...
@@ -69,18 +69,25 @@ ExplainQuery(Query *query, List *options, CommandDest dest)
memset
(
es
,
0
,
sizeof
(
ExplainState
));
memset
(
es
,
0
,
sizeof
(
ExplainState
));
/* parse options */
/* parse options */
es
->
printCost
=
1
;
/* default */
while
(
options
)
{
while
(
options
)
{
char
*
ostr
=
strVal
(
lfirst
(
options
));
char
*
ostr
=
strVal
(
lfirst
(
options
));
if
(
!
strcasecmp
(
ostr
,
"cost"
))
if
(
!
strcasecmp
(
ostr
,
"cost"
))
es
->
printCost
=
1
;
es
->
printCost
=
true
;
else
if
(
!
strcasecmp
(
ostr
,
"full"
))
else
if
(
!
strcasecmp
(
ostr
,
"plan"
))
es
->
printNodes
=
1
;
es
->
printNodes
=
true
;
else
if
(
!
strcasecmp
(
ostr
,
"full"
))
{
es
->
printCost
=
true
;
es
->
printNodes
=
true
;
}
else
else
elog
(
WARN
,
"Unknown EXPLAIN option: %s"
,
ostr
);
elog
(
WARN
,
"Unknown EXPLAIN option: %s"
,
ostr
);
options
=
lnext
(
options
);
options
=
lnext
(
options
);
}
}
if
(
!
es
->
printCost
&&
!
es
->
printNodes
)
es
->
printCost
=
true
;
/* default */
es
->
rtable
=
query
->
rtable
;
es
->
rtable
=
query
->
rtable
;
if
(
es
->
printNodes
)
if
(
es
->
printNodes
)
...
...
src/bin/psql/psqlHelp.h
View file @
765dd2a4
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
*
*
* Copyright (c) 1994, Regents of the University of California
* Copyright (c) 1994, Regents of the University of California
*
*
* $Id: psqlHelp.h,v 1.
8 1996/12/29 00:53:59
momjian Exp $
* $Id: psqlHelp.h,v 1.
9 1996/12/29 19:31:06
momjian Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -124,7 +124,7 @@ static struct _helpStruct QL_HELP[] = {
...
@@ -124,7 +124,7 @@ static struct _helpStruct QL_HELP[] = {
"end [transaction];"
},
"end [transaction];"
},
{
"explain"
,
{
"explain"
,
"explain the query execution plan"
,
"explain the query execution plan"
,
"explain [with {cost|full}] <query>"
},
"explain [with {cost|
plan|
full}] <query>"
},
{
"fetch"
,
{
"fetch"
,
"retrieve tuples from a cursor"
,
"retrieve tuples from a cursor"
,
"fetch [forward|backward] [<number>|all] [in <cursorname>];"
},
"fetch [forward|backward] [<number>|all] [in <cursorname>];"
},
...
...
src/man/explain.l
View file @
765dd2a4
.\" This is -*-nroff-*-
.\" This is -*-nroff-*-
.\" XXX standard disclaimer belongs here....
.\" XXX standard disclaimer belongs here....
.\" $Header: /cvsroot/pgsql/src/man/Attic/explain.l,v 1.
2 1996/12/29 03:55:3
6 momjian Exp $
.\" $Header: /cvsroot/pgsql/src/man/Attic/explain.l,v 1.
3 1996/12/29 19:31:1
6 momjian Exp $
.TH EXPLAIN SQL 11/05/95 PostgreSQL PostgreSQL
.TH EXPLAIN SQL 11/05/95 PostgreSQL PostgreSQL
.SH NAME
.SH NAME
explain \(em explains statement execution details
explain \(em explains statement execution details
.SH SYNOPSIS
.SH SYNOPSIS
.nf
.nf
\fBexplain [with\fP \fB{cost|full}]\fR query
\fBexplain [with\fP \fB{cost|
plan|
full}]\fR query
.fi
.fi
.SH DESCRIPTION
.SH DESCRIPTION
This command outputs details about the supplied query. The default
This command outputs details about the supplied query. The default
output is the computed query cost. \f2full\f1 displays a full query plan
output is the computed query cost. \f2plan\f1 displays the full query
and cost.
plan. \f2full\f1 display both query plan and query cost.
.PP
The query cost and plan can be affected by running vacuum.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment