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
99ee43c5
Commit
99ee43c5
authored
Aug 24, 2010
by
Tom Lane
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make EXPLAIN show the function call expression of a FunctionScan plan node,
but only in VERBOSE mode. Per discussion.
parent
5c788e7c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
14 deletions
+36
-14
src/backend/commands/explain.c
src/backend/commands/explain.c
+36
-14
No files found.
src/backend/commands/explain.c
View file @
99ee43c5
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1994-5, Regents of the University of California
* Portions Copyright (c) 1994-5, Regents of the University of California
*
*
* IDENTIFICATION
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/commands/explain.c,v 1.20
7 2010/07/13 20:57:19
tgl Exp $
* $PostgreSQL: pgsql/src/backend/commands/explain.c,v 1.20
8 2010/08/24 21:20:36
tgl Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -59,6 +59,9 @@ static void ExplainNode(PlanState *planstate, List *ancestors,
...
@@ -59,6 +59,9 @@ static void ExplainNode(PlanState *planstate, List *ancestors,
ExplainState
*
es
);
ExplainState
*
es
);
static
void
show_plan_tlist
(
PlanState
*
planstate
,
List
*
ancestors
,
static
void
show_plan_tlist
(
PlanState
*
planstate
,
List
*
ancestors
,
ExplainState
*
es
);
ExplainState
*
es
);
static
void
show_expression
(
Node
*
node
,
const
char
*
qlabel
,
PlanState
*
planstate
,
List
*
ancestors
,
bool
useprefix
,
ExplainState
*
es
);
static
void
show_qual
(
List
*
qual
,
const
char
*
qlabel
,
static
void
show_qual
(
List
*
qual
,
const
char
*
qlabel
,
PlanState
*
planstate
,
List
*
ancestors
,
PlanState
*
planstate
,
List
*
ancestors
,
bool
useprefix
,
ExplainState
*
es
);
bool
useprefix
,
ExplainState
*
es
);
...
@@ -1017,13 +1020,19 @@ ExplainNode(PlanState *planstate, List *ancestors,
...
@@ -1017,13 +1020,19 @@ ExplainNode(PlanState *planstate, List *ancestors,
"Recheck Cond"
,
planstate
,
ancestors
,
es
);
"Recheck Cond"
,
planstate
,
ancestors
,
es
);
/* FALL THRU */
/* FALL THRU */
case
T_SeqScan
:
case
T_SeqScan
:
case
T_FunctionScan
:
case
T_ValuesScan
:
case
T_ValuesScan
:
case
T_CteScan
:
case
T_CteScan
:
case
T_WorkTableScan
:
case
T_WorkTableScan
:
case
T_SubqueryScan
:
case
T_SubqueryScan
:
show_scan_qual
(
plan
->
qual
,
"Filter"
,
planstate
,
ancestors
,
es
);
show_scan_qual
(
plan
->
qual
,
"Filter"
,
planstate
,
ancestors
,
es
);
break
;
break
;
case
T_FunctionScan
:
if
(
es
->
verbose
)
show_expression
(((
FunctionScan
*
)
plan
)
->
funcexpr
,
"Function Call"
,
planstate
,
ancestors
,
es
->
verbose
,
es
);
show_scan_qual
(
plan
->
qual
,
"Filter"
,
planstate
,
ancestors
,
es
);
break
;
case
T_TidScan
:
case
T_TidScan
:
{
{
/*
/*
...
@@ -1282,24 +1291,16 @@ show_plan_tlist(PlanState *planstate, List *ancestors, ExplainState *es)
...
@@ -1282,24 +1291,16 @@ show_plan_tlist(PlanState *planstate, List *ancestors, ExplainState *es)
}
}
/*
/*
* Show a
qualifier
expression
* Show a
generic
expression
*/
*/
static
void
static
void
show_
qual
(
List
*
qual
,
const
char
*
qlabel
,
show_
expression
(
Node
*
node
,
const
char
*
qlabel
,
PlanState
*
planstate
,
List
*
ancestors
,
PlanState
*
planstate
,
List
*
ancestors
,
bool
useprefix
,
ExplainState
*
es
)
bool
useprefix
,
ExplainState
*
es
)
{
{
List
*
context
;
List
*
context
;
Node
*
node
;
char
*
exprstr
;
char
*
exprstr
;
/* No work if empty qual */
if
(
qual
==
NIL
)
return
;
/* Convert AND list to explicit AND */
node
=
(
Node
*
)
make_ands_explicit
(
qual
);
/* Set up deparsing context */
/* Set up deparsing context */
context
=
deparse_context_for_planstate
((
Node
*
)
planstate
,
context
=
deparse_context_for_planstate
((
Node
*
)
planstate
,
ancestors
,
ancestors
,
...
@@ -1312,6 +1313,27 @@ show_qual(List *qual, const char *qlabel,
...
@@ -1312,6 +1313,27 @@ show_qual(List *qual, const char *qlabel,
ExplainPropertyText
(
qlabel
,
exprstr
,
es
);
ExplainPropertyText
(
qlabel
,
exprstr
,
es
);
}
}
/*
* Show a qualifier expression (which is a List with implicit AND semantics)
*/
static
void
show_qual
(
List
*
qual
,
const
char
*
qlabel
,
PlanState
*
planstate
,
List
*
ancestors
,
bool
useprefix
,
ExplainState
*
es
)
{
Node
*
node
;
/* No work if empty qual */
if
(
qual
==
NIL
)
return
;
/* Convert AND list to explicit AND */
node
=
(
Node
*
)
make_ands_explicit
(
qual
);
/* And show it */
show_expression
(
node
,
qlabel
,
planstate
,
ancestors
,
useprefix
,
es
);
}
/*
/*
* Show a qualifier expression for a scan plan node
* Show a qualifier expression for a scan plan node
*/
*/
...
...
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