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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jakob Huber
postgres-lambda-diff
Commits
fc5173ad
Commit
fc5173ad
authored
Feb 16, 2010
by
Andrew Dunstan
Browse files
Options
Downloads
Patches
Plain Diff
Add query text to auto_explain output.
Still to be done: fix docs and fix regression failures under auto_explain.
parent
56adf370
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
contrib/auto_explain/auto_explain.c
+4
-2
4 additions, 2 deletions
contrib/auto_explain/auto_explain.c
src/backend/commands/explain.c
+16
-1
16 additions, 1 deletion
src/backend/commands/explain.c
src/include/commands/explain.h
+3
-1
3 additions, 1 deletion
src/include/commands/explain.h
with
23 additions
and
4 deletions
contrib/auto_explain/auto_explain.c
+
4
−
2
View file @
fc5173ad
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
* Copyright (c) 2008-2010, PostgreSQL Global Development Group
* Copyright (c) 2008-2010, PostgreSQL Global Development Group
*
*
* IDENTIFICATION
* IDENTIFICATION
* $PostgreSQL: pgsql/contrib/auto_explain/auto_explain.c,v 1.1
2
2010/0
1/06 18:07:19 tgl
Exp $
* $PostgreSQL: pgsql/contrib/auto_explain/auto_explain.c,v 1.1
3
2010/0
2/16 22:19:59 adunstan
Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -240,6 +240,7 @@ explain_ExecutorEnd(QueryDesc *queryDesc)
...
@@ -240,6 +240,7 @@ explain_ExecutorEnd(QueryDesc *queryDesc)
es
.
format
=
auto_explain_log_format
;
es
.
format
=
auto_explain_log_format
;
ExplainBeginOutput
(
&
es
);
ExplainBeginOutput
(
&
es
);
ExplainQueryText
(
&
es
,
queryDesc
);
ExplainPrintPlan
(
&
es
,
queryDesc
);
ExplainPrintPlan
(
&
es
,
queryDesc
);
ExplainEndOutput
(
&
es
);
ExplainEndOutput
(
&
es
);
...
@@ -255,7 +256,8 @@ explain_ExecutorEnd(QueryDesc *queryDesc)
...
@@ -255,7 +256,8 @@ explain_ExecutorEnd(QueryDesc *queryDesc)
*/
*/
ereport
(
LOG
,
ereport
(
LOG
,
(
errmsg
(
"duration: %.3f ms plan:
\n
%s"
,
(
errmsg
(
"duration: %.3f ms plan:
\n
%s"
,
msec
,
es
.
str
->
data
)));
msec
,
es
.
str
->
data
),
errhidestmt
(
true
)));
pfree
(
es
.
str
->
data
);
pfree
(
es
.
str
->
data
);
}
}
...
...
...
...
This diff is collapsed.
Click to expand it.
src/backend/commands/explain.c
+
16
−
1
View file @
fc5173ad
...
@@ -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
2
2010/02/16 2
0:07:13
sta
rk
Exp $
* $PostgreSQL: pgsql/src/backend/commands/explain.c,v 1.20
3
2010/02/16 2
2:19:59 adun
sta
n
Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -487,6 +487,21 @@ ExplainPrintPlan(ExplainState *es, QueryDesc *queryDesc)
...
@@ -487,6 +487,21 @@ ExplainPrintPlan(ExplainState *es, QueryDesc *queryDesc)
NULL
,
NULL
,
NULL
,
es
);
NULL
,
NULL
,
NULL
,
es
);
}
}
/*
* ExplainQueryText -
* add a "Query Text" node that contains the actual text of the query
*
* The caller should have set up the options fields of *es, as well as
* initializing the output buffer es->str.
*
*/
void
ExplainQueryText
(
ExplainState
*
es
,
QueryDesc
*
queryDesc
)
{
if
(
queryDesc
->
sourceText
)
ExplainPropertyText
(
"Query Text"
,
queryDesc
->
sourceText
,
es
);
}
/*
/*
* report_triggers -
* report_triggers -
* report execution stats for a single relation's triggers
* report execution stats for a single relation's triggers
...
...
...
...
This diff is collapsed.
Click to expand it.
src/include/commands/explain.h
+
3
−
1
View file @
fc5173ad
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
* Portions Copyright (c) 1996-2010, PostgreSQL Global Development Group
* Portions Copyright (c) 1996-2010, PostgreSQL Global Development Group
* Portions Copyright (c) 1994-5, Regents of the University of California
* Portions Copyright (c) 1994-5, Regents of the University of California
*
*
* $PostgreSQL: pgsql/src/include/commands/explain.h,v 1.4
5
2010/0
1/02 16:58:03 momji
an Exp $
* $PostgreSQL: pgsql/src/include/commands/explain.h,v 1.4
6
2010/0
2/16 22:19:59 adunst
an Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -66,6 +66,8 @@ extern void ExplainOnePlan(PlannedStmt *plannedstmt, ExplainState *es,
...
@@ -66,6 +66,8 @@ extern void ExplainOnePlan(PlannedStmt *plannedstmt, ExplainState *es,
extern
void
ExplainPrintPlan
(
ExplainState
*
es
,
QueryDesc
*
queryDesc
);
extern
void
ExplainPrintPlan
(
ExplainState
*
es
,
QueryDesc
*
queryDesc
);
extern
void
ExplainQueryText
(
ExplainState
*
es
,
QueryDesc
*
queryDesc
);
extern
void
ExplainBeginOutput
(
ExplainState
*
es
);
extern
void
ExplainBeginOutput
(
ExplainState
*
es
);
extern
void
ExplainEndOutput
(
ExplainState
*
es
);
extern
void
ExplainEndOutput
(
ExplainState
*
es
);
extern
void
ExplainSeparatePlans
(
ExplainState
*
es
);
extern
void
ExplainSeparatePlans
(
ExplainState
*
es
);
...
...
...
...
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