提交 9f8a38b4 编写于 作者: D Daniel Gustafsson

Remove dead code from resource manager

FindOperatorGroupForNode() has been commented out for six years
almost to the day, with no reason in the original commit as to
why it was commented out in the first place. Remove since it
clearly is neither used nor needed.
Reviewed-by: NJoao Pedro De Almeida Pereira <jdealmeidapereira@pivotal.io>
上级 92caaeed
......@@ -570,90 +570,6 @@ FindOperatorGroupForOperator(Node *node,
return groupNode;
}
#if 0
/*
* FindOperatorGroupForNode
* find the operator group for a given node.
*
* If this is during prelim walker phase, this function creates such a group
* if it does not exist. Otherwise, this function finds such a group in
* the group tree.
*
* This function also returns the parentGroupNode pointer, and a boolean
* indicating if the given node is the first node in the group.
*/
static OperatorGroupNode *
FindOperatorGroupForNode(Node *node,
PolicyEagerFreeContext *context,
bool isPrelimWalker,
OperatorGroupNode **parentGroupNodeP,
bool *isFirstInGroupP)
{
Assert(is_plan_node(node));
OperatorGroupNode *groupNode = context->groupNode;
if (context->groupNode == NULL)
{
if (isPrelimWalker)
{
Assert(context->groupTree == NULL);
context->groupTree = CreateOperatorGroupNode(context->nextGroupId, NULL);
groupNode = context->groupTree;
/* The memory limit for the first group is the query memory limit. */
groupNode->groupMemKB = context->queryMemKB;
}
else
{
Assert(context->groupTree != NULL);
groupNode = context->groupTree;
Assert(groupNode->groupMemKB > 0);
}
context->nextGroupId++;
*isFirstInGroupP = true;
}
/*
* If this node is a blocking operator and this node does not contain an extParam,
* it means that the current group ends, and a new group starts.
*/
if (!*isFirstInGroupP &&
IsRootOperatorInGroup(node))
{
Assert(context->groupNode != NULL);
if (isPrelimWalker)
{
groupNode = CreateOperatorGroupNode(context->nextGroupId, context->groupNode);
context->groupNode->childGroups = lappend(context->groupNode->childGroups, groupNode);
}
else
{
ListCell *lc = NULL;
OperatorGroupNode *childGroup = NULL;
foreach(lc, context->groupNode->childGroups)
{
childGroup = (OperatorGroupNode *)lfirst(lc);
if (childGroup->groupId == context->nextGroupId)
{
break;
}
}
Assert(childGroup != NULL);
groupNode = childGroup;
}
context->nextGroupId++;
*isFirstInGroupP = true;
*parentGroupNodeP = context->groupNode;
}
return groupNode;
}
#endif
/*
* ComputeAvgMemKBForMemIntenseOp
* Compute the average memory limit for each memory-intensive operators
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册