From f4c28d848b911285f4d087ad9f6ac45375a38f28 Mon Sep 17 00:00:00 2001 From: slzhou Date: Tue, 25 Jul 2023 15:23:00 +0800 Subject: [PATCH] fix: table merge scan use heap sort when there is limit --- source/libs/executor/src/scanoperator.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/libs/executor/src/scanoperator.c b/source/libs/executor/src/scanoperator.c index 677f2db298..9e5d3a3ab6 100644 --- a/source/libs/executor/src/scanoperator.c +++ b/source/libs/executor/src/scanoperator.c @@ -2843,7 +2843,7 @@ int32_t startGroupTableMergeScan(SOperatorInfo* pOperator) { mergeLimit = pInfo->limitInfo.limit.limit + pInfo->limitInfo.limit.offset; } size_t szRow = blockDataGetRowSize(pInfo->pResBlock); - if (szRow > 1024 && hasLimit) { + if (hasLimit) { pInfo->pSortHandle = tsortCreateSortHandle(pInfo->pSortInfo, SORT_SINGLESOURCE_SORT, -1, -1, NULL, pTaskInfo->id.str, mergeLimit, szRow+8, tsPQSortMemThreshold * 1024* 1024); } else { -- GitLab