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

postfix: propagate ts order to parents for more logic nodes

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