fix: don't copy all data when use limit

This commit is contained in:
factosea 2024-02-22 17:03:17 +08:00
parent 5de8617a32
commit 3341d02060
2 changed files with 2 additions and 1 deletions

View File

@ -1688,6 +1688,7 @@ int32_t blockDataTrimFirstRows(SSDataBlock* pBlock, size_t n) {
static void colDataKeepFirstNRows(SColumnInfoData* pColInfoData, size_t n, size_t total) { static void colDataKeepFirstNRows(SColumnInfoData* pColInfoData, size_t n, size_t total) {
if (IS_VAR_DATA_TYPE(pColInfoData->info.type)) { if (IS_VAR_DATA_TYPE(pColInfoData->info.type)) {
pColInfoData->varmeta.length = pColInfoData->varmeta.offset[n];
// pColInfoData->varmeta.length = colDataMoveVarData(pColInfoData, 0, n); // pColInfoData->varmeta.length = colDataMoveVarData(pColInfoData, 0, n);
memset(&pColInfoData->varmeta.offset[n], 0, total - n); memset(&pColInfoData->varmeta.offset[n], 0, total - n);
} }

View File

@ -648,7 +648,7 @@ int32_t qExecTaskOpt(qTaskInfo_t tinfo, SArray* pResList, uint64_t* useconds, bo
ASSERT(p->info.rows > 0 || p->info.type == STREAM_CHECKPOINT); ASSERT(p->info.rows > 0 || p->info.type == STREAM_CHECKPOINT);
taosArrayPush(pResList, &p); taosArrayPush(pResList, &p);
if (current >= rowsThreshold) { if (current >= rowsThreshold || current >= pRes->info.rows) {
break; break;
} }