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
fc5173ad
Commit
fc5173ad
authored
Feb 16, 2010
by
Andrew Dunstan
Browse files
Options
Browse Files
Download
Email 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
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
4 deletions
+23
-4
contrib/auto_explain/auto_explain.c
contrib/auto_explain/auto_explain.c
+4
-2
src/backend/commands/explain.c
src/backend/commands/explain.c
+16
-1
src/include/commands/explain.h
src/include/commands/explain.h
+3
-1
No files found.
contrib/auto_explain/auto_explain.c
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/01/06 18:07:19 tgl
Exp $
* $PostgreSQL: pgsql/contrib/auto_explain/auto_explain.c,v 1.1
3 2010/02/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
);
}
}
...
...
src/backend/commands/explain.c
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 20:07:13 stark
Exp $
* $PostgreSQL: pgsql/src/backend/commands/explain.c,v 1.20
3 2010/02/16 22:19:59 adunstan
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
...
...
src/include/commands/explain.h
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/01/02 16:58:03 momji
an Exp $
* $PostgreSQL: pgsql/src/include/commands/explain.h,v 1.4
6 2010/02/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
);
...
...
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