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
3a02ccfa
Commit
3a02ccfa
authored
Jan 16, 1997
by
Bruce Momjian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Change EXPLAIN options to just use VERBOSE.
parent
b00c2c1d
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
19 additions
and
40 deletions
+19
-40
src/backend/commands/explain.c
src/backend/commands/explain.c
+5
-20
src/backend/parser/gram.y
src/backend/parser/gram.y
+4
-10
src/backend/tcop/utility.c
src/backend/tcop/utility.c
+2
-2
src/include/commands/explain.h
src/include/commands/explain.h
+2
-2
src/include/nodes/parsenodes.h
src/include/nodes/parsenodes.h
+2
-2
src/man/explain.l
src/man/explain.l
+4
-4
No files found.
src/backend/commands/explain.c
View file @
3a02ccfa
...
...
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/commands/explain.c,v 1.
7 1996/12/29 19:30:55
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/commands/explain.c,v 1.
8 1997/01/16 14:55:58
momjian Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -41,7 +41,7 @@ static char *Explain_PlanToString(Plan *plan, ExplainState *es);
*
*/
void
ExplainQuery
(
Query
*
query
,
List
*
options
,
CommandDest
dest
)
ExplainQuery
(
Query
*
query
,
bool
verbose
,
CommandDest
dest
)
{
char
*
s
=
NULL
,
*
s2
;
Plan
*
plan
;
...
...
@@ -68,25 +68,10 @@ ExplainQuery(Query *query, List *options, CommandDest dest)
es
=
(
ExplainState
*
)
malloc
(
sizeof
(
ExplainState
));
memset
(
es
,
0
,
sizeof
(
ExplainState
));
/* parse options */
while
(
options
)
{
char
*
ostr
=
strVal
(
lfirst
(
options
));
if
(
!
strcasecmp
(
ostr
,
"cost"
))
es
->
printCost
=
true
;
else
if
(
!
strcasecmp
(
ostr
,
"plan"
))
es
->
printNodes
=
true
;
else
if
(
!
strcasecmp
(
ostr
,
"full"
))
{
es
->
printCost
=
true
;
es
->
printNodes
=
true
;
}
else
elog
(
WARN
,
"Unknown EXPLAIN option: %s"
,
ostr
);
options
=
lnext
(
options
);
}
es
->
printCost
=
true
;
/* default */
if
(
!
es
->
printCost
&&
!
es
->
printNodes
)
es
->
printCost
=
true
;
/* default */
if
(
verbose
)
es
->
printNodes
=
true
;
es
->
rtable
=
query
->
rtable
;
...
...
src/backend/parser/gram.y
View file @
3a02ccfa
...
...
@@ -10,7 +10,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 1.2
4 1997/01/13 03:44:18
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 1.2
5 1997/01/16 14:56:05
momjian Exp $
*
* HISTORY
* AUTHOR DATE MAJOR EVENT
...
...
@@ -131,7 +131,7 @@ static Node *makeA_Expr(int oper, char *opname, Node *lexpr, Node *rexpr);
sort_clause, sortby_list, index_params,
name_list, from_clause, from_list, opt_array_bounds, nest_array_bounds,
expr_list, attrs, res_target_list, res_target_list2,
def_list, opt_indirection, group_clause, groupby_list
, explain_options
def_list, opt_indirection, group_clause, groupby_list
%type <boolean> opt_inh_star, opt_binary, opt_instead, opt_with_copy,
index_opt_unique, opt_verbose
...
...
@@ -1227,21 +1227,15 @@ opt_verbose: VERBOSE { $$ = TRUE; }
*
*****************************************************************************/
ExplainStmt: EXPLAIN
explain_options
OptimizableStmt
ExplainStmt: EXPLAIN
opt_verbose
OptimizableStmt
{
ExplainStmt *n = makeNode(ExplainStmt);
n->verbose = $2;
n->query = (Query*)$3;
n->options = $2;
$$ = (Node *)n;
}
;
explain_options: WITH name_list
{ $$ = $2; }
| /*EMPTY*/
{ $$ = NIL; }
;
/*****************************************************************************
* *
* Optimizable Stmts: *
...
...
src/backend/tcop/utility.c
View file @
3a02ccfa
...
...
@@ -9,7 +9,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/tcop/utility.c,v 1.1
0 1997/01/13 03:44:38
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/tcop/utility.c,v 1.1
1 1997/01/16 14:56:21
momjian Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -591,7 +591,7 @@ ProcessUtility(Node *parsetree,
commandTag
=
"EXPLAIN"
;
CHECK_IF_ABORTED
();
ExplainQuery
(
stmt
->
query
,
stmt
->
options
,
dest
);
ExplainQuery
(
stmt
->
query
,
stmt
->
verbose
,
dest
);
}
break
;
...
...
src/include/commands/explain.h
View file @
3a02ccfa
...
...
@@ -5,13 +5,13 @@
*
* Copyright (c) 1994-5, Regents of the University of California
*
* $Id: explain.h,v 1.
1 1996/08/28 07:21:47 scrappy
Exp $
* $Id: explain.h,v 1.
2 1997/01/16 14:56:34 momjian
Exp $
*
*-------------------------------------------------------------------------
*/
#ifndef EXPLAIN_H
#define EXPLAIN_H
extern
void
ExplainQuery
(
Query
*
query
,
List
*
options
,
CommandDest
dest
);
extern
void
ExplainQuery
(
Query
*
query
,
bool
verbose
,
CommandDest
dest
);
#endif
/* EXPLAIN_H*/
src/include/nodes/parsenodes.h
View file @
3a02ccfa
...
...
@@ -6,7 +6,7 @@
*
* Copyright (c) 1994, Regents of the University of California
*
* $Id: parsenodes.h,v 1.
9 1997/01/13 03:45:02
momjian Exp $
* $Id: parsenodes.h,v 1.
10 1997/01/16 14:56:45
momjian Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -408,7 +408,7 @@ typedef struct VacuumStmt {
typedef
struct
ExplainStmt
{
NodeTag
type
;
Query
*
query
;
/* the query */
List
*
options
;
bool
verbose
;
/* print plan info */
}
ExplainStmt
;
...
...
src/man/explain.l
View file @
3a02ccfa
.\" This is -*-nroff-*-
.\" XXX standard disclaimer belongs here....
.\" $Header: /cvsroot/pgsql/src/man/Attic/explain.l,v 1.
3 1996/12/29 19:31:16
momjian Exp $
.\" $Header: /cvsroot/pgsql/src/man/Attic/explain.l,v 1.
4 1997/01/16 14:56:59
momjian Exp $
.TH EXPLAIN SQL 11/05/95 PostgreSQL PostgreSQL
.SH NAME
explain \(em explains statement execution details
.SH SYNOPSIS
.nf
\fBexplain [
with\fP \fB{cost|plan|full}
]\fR query
\fBexplain [
verbose
]\fR query
.fi
.SH DESCRIPTION
This command outputs details about the supplied query. The default
output is the computed query cost. \f2
plan
\f1 displays the full query
plan
. \f2full\f1 display both query plan and query
cost.
output is the computed query cost. \f2
verbose
\f1 displays the full query
plan
and
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