summaryrefslogtreecommitdiff
path: root/src/include/optimizer/optimizer.h
diff options
context:
space:
mode:
authorRobert Haas <rhaas@postgresql.org>2025-10-08 08:33:29 -0400
committerRobert Haas <rhaas@postgresql.org>2025-10-08 08:33:29 -0400
commitc83ac02ec7309edb7561eee93895c31a54b93d3d (patch)
tree6cae6dc6ebe7615af87e6df9ac9aa0c019c4d1e8 /src/include/optimizer/optimizer.h
parent8e11859102f947e6145acdd809e5cdcdfbe90fa5 (diff)
Add ExplainState argument to pg_plan_query() and planner().
This allows extensions to have access to any data they've stored in the ExplainState during planning. Unfortunately, it won't help with EXPLAIN EXECUTE is used, but since that case is less common, this still seems like an improvement. Since planner() has quite a few arguments now, also add some documentation of those arguments and the return value. Author: Robert Haas <rhaas@postgresql.org> Co-authored-by: Tom Lane <tgl@sss.pgh.pa.us> Reviewed-by: Andrei Lepikhov <lepihov@gmail.com> Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us> Discussion: http://postgr.es/m/CA+TgmoYWKHU2hKr62Toyzh-kTDEnMDeLw7gkOOnjL-TnOUq0kQ@mail.gmail.com
Diffstat (limited to 'src/include/optimizer/optimizer.h')
-rw-r--r--src/include/optimizer/optimizer.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/include/optimizer/optimizer.h b/src/include/optimizer/optimizer.h
index 04878f1f1c2..a34113903c0 100644
--- a/src/include/optimizer/optimizer.h
+++ b/src/include/optimizer/optimizer.h
@@ -24,6 +24,8 @@
#include "nodes/parsenodes.h"
+typedef struct ExplainState ExplainState; /* defined in explain_state.h */
+
/*
* We don't want to include nodes/pathnodes.h here, because non-planner
* code should generally treat PlannerInfo as an opaque typedef.
@@ -104,7 +106,8 @@ extern PGDLLIMPORT bool enable_distinct_reordering;
extern PlannedStmt *planner(Query *parse, const char *query_string,
int cursorOptions,
- ParamListInfo boundParams);
+ ParamListInfo boundParams,
+ ExplainState *es);
extern Expr *expression_planner(Expr *expr);
extern Expr *expression_planner_with_deps(Expr *expr,