diff --git a/source/libs/executor/src/scanoperator.c b/source/libs/executor/src/scanoperator.c index d53228590ce73c43ad35fb643ec82b5262fd1ea5..15fc164cf19893bd432f4ecb3365d4df79a6b6b3 100644 --- a/source/libs/executor/src/scanoperator.c +++ b/source/libs/executor/src/scanoperator.c @@ -2790,6 +2790,10 @@ int32_t startGroupTableMergeScan(SOperatorInfo* pOperator) { kWay = 256; } else if (kWay <= 2) { kWay = 2; + } else { + int i = 2; + while (i * 2 <= kWay) i = i * 2; + kWay = i; } pInfo->sortBufSize = pInfo->bufPageSize * (kWay + 1);