mirror of
https://github.com/postgres/postgres.git
synced 2025-12-19 17:02:53 +03:00
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
This commit is contained in:
@@ -40,17 +40,18 @@ static planner_hook_type prev_planner_hook = NULL;
|
||||
/* planner_hook function to provide the desired delay */
|
||||
static PlannedStmt *
|
||||
delay_execution_planner(Query *parse, const char *query_string,
|
||||
int cursorOptions, ParamListInfo boundParams)
|
||||
int cursorOptions, ParamListInfo boundParams,
|
||||
ExplainState *es)
|
||||
{
|
||||
PlannedStmt *result;
|
||||
|
||||
/* Invoke the planner, possibly via a previous hook user */
|
||||
if (prev_planner_hook)
|
||||
result = prev_planner_hook(parse, query_string, cursorOptions,
|
||||
boundParams);
|
||||
boundParams, es);
|
||||
else
|
||||
result = standard_planner(parse, query_string, cursorOptions,
|
||||
boundParams);
|
||||
boundParams, es);
|
||||
|
||||
/* If enabled, delay by taking and releasing the specified lock */
|
||||
if (post_planning_lock_id != 0)
|
||||
|
||||
Reference in New Issue
Block a user