提交 70681238 编写于 作者: H Heikki Linnakangas

Update comment to explain why we need to insert Result nodes here.

I figures out the reason this is needed. It was alluded to by the
"This is so the executor can use a faster path to evaluate the  given
node's targetlist" comment, but hopefully this new comment makes it
more clear what the "faster path" is.

Remove the GPDB_83_MERGE_FIXME comment. There's a new mechanism for
dealing with SRFs in targetlists in the works for PostgreSQL 10
as of this writing, but until then, I think we'll live with this.
上级 e87fd575
......@@ -2444,8 +2444,13 @@ cdb_expr_requires_full_eval(Node *node)
* Adjusts the tree so that the target list of the given Plan node
* will contain only Var nodes. The old target list is moved onto
* a new Result node which will be inserted above the given node.
* This is so the executor can use a faster path to evaluate the
* given node's targetlist. Returns the new Result node.
* Returns the new result node.
*
* This is needed, because we have gutted out the support for evaluating
* set-returning-functions in targetlists in the executor, in all
* nodes except the Result node. That gives a marginal performance
* gain when there are no set-returning-functions in the target list,
* which is the common case.
*/
Plan *
cdb_insert_result_node(PlannerGlobal *glob, Plan *plan, int rtoffset)
......@@ -2460,12 +2465,13 @@ cdb_insert_result_node(PlannerGlobal *glob, Plan *plan, int rtoffset)
flow = plan->flow;
plan->flow = NULL;
/* Build a Result node to take over the targetlist from the given Plan. */
/*
* GPDB_83_MERGE_FIXME: We don't have a PlannerInfo struct at hand here,
* so we pass NULL and hope that make_result doesn't really need it.
* It's really too late to insert Result nodes at this late stage in the
* planner, we should eliminate the need for this
* Build a Result node to take over the targetlist from the given Plan.
*
* XXX: We don't have a PlannerInfo struct at hand here, so we pass NULL
* and hope that make_result doesn't really need it. It's really too late
* to insert Result nodes at this late stage in the planner, we should
* eliminate the need for this.
*/
resultplan = (Plan *) make_result(NULL, plan->targetlist, NULL, plan);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册