Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit2ecb9ce

Browse files
committed
Changes in the core patch we needed to fit the proposed explain hooks.
1 parent7d07684 commit2ecb9ce

File tree

1 file changed

+0
-69
lines changed

1 file changed

+0
-69
lines changed

‎aqo_master.patch

Lines changed: 0 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,3 @@
1-
diff --git a/src/backend/commands/explain.c b/src/backend/commands/explain.c
2-
index 22616cf7add..8a28b783f72 100644
3-
--- a/src/backend/commands/explain.c
4-
+++ b/src/backend/commands/explain.c
5-
@@ -29,6 +29,7 @@
6-
#include "nodes/extensible.h"
7-
#include "nodes/makefuncs.h"
8-
#include "nodes/nodeFuncs.h"
9-
+#include "optimizer/cost.h"
10-
#include "parser/analyze.h"
11-
#include "parser/parsetree.h"
12-
#include "rewrite/rewriteHandler.h"
13-
@@ -45,6 +46,12 @@
14-
#include "utils/typcache.h"
15-
#include "utils/xml.h"
16-
17-
+/* Hook for plugins to get control in ExplainOnePlan() */
18-
+ExplainOnePlan_hook_type ExplainOnePlan_hook = NULL;
19-
+
20-
+/* Hook for plugins to get control in ExplainOnePlan() */
21-
+ExplainOneNode_hook_type ExplainOneNode_hook = NULL;
22-
+
23-
24-
/* Hook for plugins to get control in ExplainOneQuery() */
25-
ExplainOneQuery_hook_type ExplainOneQuery_hook = NULL;
26-
@@ -690,6 +697,10 @@ ExplainOnePlan(PlannedStmt *plannedstmt, CachedPlan *cplan,
27-
ExplainPropertyFloat("Execution Time", "ms", 1000.0 * totaltime, 3,
28-
es);
29-
30-
+if (ExplainOnePlan_hook)
31-
+ExplainOnePlan_hook(plannedstmt, into, es,
32-
+queryString, params, planduration, queryEnv);
33-
+
34-
ExplainCloseGroup("Query", NULL, true, es);
35-
}
36-
37-
@@ -1884,6 +1895,9 @@ ExplainNode(PlanState *planstate, List *ancestors,
38-
}
39-
}
40-
41-
+if (ExplainOneNode_hook)
42-
+ExplainOneNode_hook(es, planstate, plan);
43-
+
44-
/* in text format, first line ends here */
45-
if (es->format == EXPLAIN_FORMAT_TEXT)
46-
appendStringInfoChar(es->str, '\n');
471
diff --git a/src/backend/optimizer/path/costsize.c b/src/backend/optimizer/path/costsize.c
482
index 256568d05a2..914f6124e67 100644
493
--- a/src/backend/optimizer/path/costsize.c
@@ -520,29 +474,6 @@ index 5b35debc8ff..06a7bebe4f8 100644
520474
/*
521475
* estimate_num_groups- Estimate number of groups in a grouped query
522476
*
523-
diff --git a/src/include/commands/explain.h b/src/include/commands/explain.h
524-
index e8e92f966a1..323b3391b35 100644
525-
--- a/src/include/commands/explain.h
526-
+++ b/src/include/commands/explain.h
527-
@@ -49,6 +49,18 @@ extern PGDLLIMPORT explain_per_node_hook_type explain_per_node_hook;
528-
typedef const char *(*explain_get_index_name_hook_type) (Oid indexId);
529-
extern PGDLLIMPORT explain_get_index_name_hook_type explain_get_index_name_hook;
530-
531-
+/* Hook for plugins to get control in ExplainOnePlan() */
532-
+typedef void (*ExplainOnePlan_hook_type) (PlannedStmt *plannedstmt, IntoClause *into,
533-
+ struct ExplainState *es, const char *queryString,
534-
+ ParamListInfo params, const instr_time *planduration,
535-
+ QueryEnvironment *queryEnv);
536-
+extern PGDLLIMPORT ExplainOnePlan_hook_type ExplainOnePlan_hook;
537-
+
538-
+/* Explain a node info */
539-
+typedef void (*ExplainOneNode_hook_type) (struct ExplainState *es,
540-
+ PlanState *ps,
541-
+ Plan *plan);
542-
+extern PGDLLIMPORT ExplainOneNode_hook_type ExplainOneNode_hook;
543-
544-
extern void ExplainQuery(ParseState *pstate, ExplainStmt *stmt,
545-
ParamListInfo params, DestReceiver *dest);
546477
diff --git a/src/include/nodes/pathnodes.h b/src/include/nodes/pathnodes.h
547478
index fbf05322c75..8fcb1fadda6 100644
548479
--- a/src/include/nodes/pathnodes.h

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp