Merge pull request #25128 from taosdata/fix/TS-4578

adjust project optimize rule
This commit is contained in:
dapan1121 2024-03-20 14:11:47 +08:00 committed by GitHub
commit 33c634d5ad
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 7 additions and 0 deletions

View File

@ -2049,6 +2049,13 @@ static bool eliminateProjOptMayBeOptimized(SLogicNode* pNode) {
return false;
}
if (QUERY_NODE_LOGIC_PLAN_DYN_QUERY_CTRL == nodeType(nodesListGetNode(pNode->pChildren, 0))) {
SLogicNode* pChild = (SLogicNode*)nodesListGetNode(pNode->pChildren, 0);
if(LIST_LENGTH(pChild->pTargets) != LIST_LENGTH(pNode->pTargets)) {
return false;
}
}
SProjectLogicNode* pProjectNode = (SProjectLogicNode*)pNode;
if (NULL != pProjectNode->node.pLimit || NULL != pProjectNode->node.pSlimit ||
NULL != pProjectNode->node.pConditions) {