From 70419dcbc65f0be7fab754b63de0bc862d207fee Mon Sep 17 00:00:00 2001 From: slzhou Date: Thu, 21 Dec 2023 08:22:22 +0800 Subject: [PATCH] fix: change memory size for row storage in memory pages --- source/libs/executor/src/scanoperator.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/source/libs/executor/src/scanoperator.c b/source/libs/executor/src/scanoperator.c index 39572648e9..b567d46a4a 100644 --- a/source/libs/executor/src/scanoperator.c +++ b/source/libs/executor/src/scanoperator.c @@ -3575,8 +3575,9 @@ int32_t startRowIdSort(STableMergeScanInfo *pInfo) { STmsSortRowIdInfo* pSort = &pInfo->sortRowIdInfo; int32_t pageSize = getProperSortPageSize(blockDataGetRowSize(pInfo->pResBlock), taosArrayGetSize(pInfo->pResBlock->pDataBlock)); - pageSize *= 2; - int32_t memSize = MIN(pageSize * 2048, 256 * 1024 * 1024); + pageSize *= 2; + int numOfTables = pInfo->tableEndIndex - pInfo->tableStartIndex + 1; + int32_t memSize = MIN(pageSize * numOfTables, 512 * 1024 * 1024); int32_t code = createDiskbasedBuf(&pSort->pExtSrcRowsBuf, pageSize * 2, memSize, "tms-ext-src-block", tsTempDir); dBufSetPrintInfo(pSort->pExtSrcRowsBuf); return code;