提交 632fb40a 编写于 作者: W wangjiaming0909

postfix: propagate ts order to parents for more logic nodes

上级 52cd4f0c
......@@ -167,25 +167,25 @@ static bool scanPathOptMayBeOptimized(SLogicNode* pNode) {
if (QUERY_NODE_LOGIC_PLAN_SCAN != nodeType(pNode)) {
return false;
}
if (NULL == pNode->pParent || (QUERY_NODE_LOGIC_PLAN_WINDOW != nodeType(pNode->pParent) &&
QUERY_NODE_LOGIC_PLAN_AGG != nodeType(pNode->pParent) &&
QUERY_NODE_LOGIC_PLAN_PARTITION != nodeType(pNode->pParent))) {
return false;
}
if ((QUERY_NODE_LOGIC_PLAN_WINDOW == nodeType(pNode->pParent) &&
WINDOW_TYPE_INTERVAL == ((SWindowLogicNode*)pNode->pParent)->winType) ||
(QUERY_NODE_LOGIC_PLAN_PARTITION == nodeType(pNode->pParent) && pNode->pParent->pParent &&
QUERY_NODE_LOGIC_PLAN_WINDOW == nodeType(pNode->pParent->pParent) &&
return true;
}
static bool scanPathOptShouldGetFuncs(SLogicNode* pNode) {
if ((QUERY_NODE_LOGIC_PLAN_WINDOW == nodeType(pNode) &&
WINDOW_TYPE_INTERVAL == ((SWindowLogicNode*)pNode)->winType) ||
(QUERY_NODE_LOGIC_PLAN_PARTITION == nodeType(pNode) && pNode->pParent &&
QUERY_NODE_LOGIC_PLAN_WINDOW == nodeType(pNode->pParent) &&
WINDOW_TYPE_INTERVAL == ((SWindowLogicNode*)pNode->pParent)->winType)) {
return true;
}
if (QUERY_NODE_LOGIC_PLAN_AGG == nodeType(pNode->pParent)) {
return !scanPathOptHaveNormalCol(((SAggLogicNode*)pNode->pParent)->pGroupKeys);
if (QUERY_NODE_LOGIC_PLAN_AGG == nodeType(pNode)) {
return !scanPathOptHaveNormalCol(((SAggLogicNode*)pNode)->pGroupKeys);
}
return false;
}
static SNodeList* scanPathOptGetAllFuncs(SLogicNode* pNode) {
if (!scanPathOptShouldGetFuncs(pNode)) return NULL;
switch (nodeType(pNode)) {
case QUERY_NODE_LOGIC_PLAN_WINDOW:
return ((SWindowLogicNode*)pNode)->pFuncs;
......
......@@ -2000,7 +2000,7 @@ QUERY_PLAN: -> Data Exchange 1:1 (width=12)
*************************** 6.row ***************************
QUERY_PLAN: Output: columns=2 width=12
*************************** 7.row ***************************
QUERY_PLAN: -> Sort input_order=unknown output_order=unknown (columns=2 width=12)
QUERY_PLAN: -> Sort input_order=asc output_order=unknown (columns=2 width=12)
*************************** 8.row ***************************
QUERY_PLAN: Output: columns=2 width=12
*************************** 9.row ***************************
......@@ -2014,7 +2014,7 @@ QUERY_PLAN: -> Data Exchange 1:1 (width=12)
*************************** 13.row ***************************
QUERY_PLAN: Output: columns=2 width=12
*************************** 14.row ***************************
QUERY_PLAN: -> Sort input_order=unknown output_order=unknown (columns=2 width=12)
QUERY_PLAN: -> Sort input_order=asc output_order=unknown (columns=2 width=12)
*************************** 15.row ***************************
QUERY_PLAN: Output: columns=2 width=12
*************************** 16.row ***************************
......@@ -2074,7 +2074,7 @@ QUERY_PLAN: -> Data Exchange 1:1 (width=12)
*************************** 12.row ***************************
QUERY_PLAN: Output: columns=2 width=12
*************************** 13.row ***************************
QUERY_PLAN: -> Sort input_order=unknown output_order=unknown (columns=2 width=12)
QUERY_PLAN: -> Sort input_order=asc output_order=unknown (columns=2 width=12)
*************************** 14.row ***************************
QUERY_PLAN: Output: columns=2 width=12
*************************** 15.row ***************************
......@@ -2088,7 +2088,7 @@ QUERY_PLAN: -> Data Exchange 1:1 (width=12)
*************************** 19.row ***************************
QUERY_PLAN: Output: columns=2 width=12
*************************** 20.row ***************************
QUERY_PLAN: -> Sort input_order=unknown output_order=unknown (columns=2 width=12)
QUERY_PLAN: -> Sort input_order=asc output_order=unknown (columns=2 width=12)
*************************** 21.row ***************************
QUERY_PLAN: Output: columns=2 width=12
*************************** 22.row ***************************
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册