Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
postgres-lambda-diff
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jakob Huber
postgres-lambda-diff
Commits
99ee43c5
Commit
99ee43c5
authored
14 years ago
by
Tom Lane
Browse files
Options
Downloads
Patches
Plain Diff
Make EXPLAIN show the function call expression of a FunctionScan plan node,
but only in VERBOSE mode. Per discussion.
parent
5c788e7c
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/backend/commands/explain.c
+36
-14
36 additions, 14 deletions
src/backend/commands/explain.c
with
36 additions
and
14 deletions
src/backend/commands/explain.c
+
36
−
14
View file @
99ee43c5
...
...
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1994-5, Regents of the University of California
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/commands/explain.c,v 1.20
7
2010/0
7/13 20:57:19
tgl Exp $
* $PostgreSQL: pgsql/src/backend/commands/explain.c,v 1.20
8
2010/0
8/24 21:20:36
tgl Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -59,6 +59,9 @@ static void ExplainNode(PlanState *planstate, List *ancestors,
ExplainState
*
es
);
static
void
show_plan_tlist
(
PlanState
*
planstate
,
List
*
ancestors
,
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
,
PlanState
*
planstate
,
List
*
ancestors
,
bool
useprefix
,
ExplainState
*
es
);
...
...
@@ -1017,13 +1020,19 @@ ExplainNode(PlanState *planstate, List *ancestors,
"Recheck Cond"
,
planstate
,
ancestors
,
es
);
/* FALL THRU */
case
T_SeqScan
:
case
T_FunctionScan
:
case
T_ValuesScan
:
case
T_CteScan
:
case
T_WorkTableScan
:
case
T_SubqueryScan
:
show_scan_qual
(
plan
->
qual
,
"Filter"
,
planstate
,
ancestors
,
es
);
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
:
{
/*
...
...
@@ -1282,24 +1291,16 @@ show_plan_tlist(PlanState *planstate, List *ancestors, ExplainState *es)
}
/*
* Show a
qualifier
expression
* Show a
generic
expression
*/
static
void
show_
qual
(
List
*
qual
,
const
char
*
qlabel
,
show_
expression
(
Node
*
node
,
const
char
*
qlabel
,
PlanState
*
planstate
,
List
*
ancestors
,
bool
useprefix
,
ExplainState
*
es
)
{
List
*
context
;
Node
*
node
;
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 */
context
=
deparse_context_for_planstate
((
Node
*
)
planstate
,
ancestors
,
...
...
@@ -1312,6 +1313,27 @@ show_qual(List *qual, const char *qlabel,
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
*/
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment