Skip to content

Commit

Permalink
Move the patch a bit later in RouterJob()
Browse files Browse the repository at this point in the history
  • Loading branch information
c2main committed Dec 23, 2024
1 parent 1cf93c1 commit 0b434dc
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
8 changes: 0 additions & 8 deletions src/backend/distributed/planner/distributed_planner.c
Original file line number Diff line number Diff line change
Expand Up @@ -217,14 +217,6 @@ distributed_planner(Query *parse,

planContext.originalQuery = copyObject(parse);

/*
* We may need to reorder parts of the planner tree we are receiving here.
* We expect to produce an SQL query text but our tree has been optimized by
* PostgreSL rewriter already...
* FIXME is there conditions to reduce the number of calls ?
*/
RebuildParserTreeFromPlannerTree(planContext.originalQuery);

if (!fastPathRouterQuery)
{
/*
Expand Down
7 changes: 7 additions & 0 deletions src/backend/distributed/planner/multi_router_planner.c
Original file line number Diff line number Diff line change
Expand Up @@ -1869,6 +1869,13 @@ RouterJob(Query *originalQuery, PlannerRestrictionContext *plannerRestrictionCon
}
else
{
/*
* We may need to reorder parts of the planner tree we are receiving here.
* We expect to produce an SQL query text but our tree has been optimized by
* PostgreSL rewriter already...
* FIXME is there conditions to reduce the number of calls ?
*/
RebuildParserTreeFromPlannerTree(originalQuery);
(*planningError) = PlanRouterQuery(originalQuery, plannerRestrictionContext,
&placementList, &shardId, &relationShardList,
&prunedShardIntervalListList,
Expand Down

0 comments on commit 0b434dc

Please sign in to comment.