Merge pull request #21567 from wangjiaming0909/fix/3.0/TD-24525
fix: prevent projectoperator scanning all rows when limit with no group
This commit is contained in:
commit
a9ed1f6d46
|
@ -647,6 +647,8 @@ uint64_t calcGroupId(char* pData, int32_t len) {
|
|||
// NOTE: only extract the initial 8 bytes of the final MD5 digest
|
||||
uint64_t id = 0;
|
||||
memcpy(&id, context.digest, sizeof(uint64_t));
|
||||
if (0 == id)
|
||||
memcpy(&id, context.digest + 8, sizeof(uint64_t));
|
||||
return id;
|
||||
}
|
||||
|
||||
|
|
|
@ -319,6 +319,11 @@ void destroyMergeJoinOperator(void* param) {
|
|||
}
|
||||
nodesDestroyNode(pJoinOperator->pCondAfterMerge);
|
||||
|
||||
taosArrayDestroy(pJoinOperator->rowCtx.leftCreatedBlocks);
|
||||
taosArrayDestroy(pJoinOperator->rowCtx.rightCreatedBlocks);
|
||||
taosArrayDestroy(pJoinOperator->rowCtx.leftRowLocations);
|
||||
taosArrayDestroy(pJoinOperator->rowCtx.rightRowLocations);
|
||||
|
||||
pJoinOperator->pRes = blockDataDestroy(pJoinOperator->pRes);
|
||||
taosMemoryFreeClear(param);
|
||||
}
|
||||
|
|
|
@ -213,6 +213,8 @@ static int32_t doIngroupLimitOffset(SLimitInfo* pLimitInfo, uint64_t groupId, SS
|
|||
} else {
|
||||
if (limitReached && (pLimitInfo->slimit.limit >= 0 && pLimitInfo->slimit.limit <= pLimitInfo->numOfOutputGroups)) {
|
||||
setOperatorCompleted(pOperator);
|
||||
} else if (limitReached && groupId == 0) {
|
||||
setOperatorCompleted(pOperator);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue