tsdb/cache: build skyline only if there's del data

This commit is contained in:
Minglei Jin 2023-08-01 16:50:00 +08:00
parent 94b9599f95
commit c997662ba0
1 changed files with 4 additions and 2 deletions

View File

@ -2507,9 +2507,11 @@ static int32_t nextRowIterGet(CacheNextRowIter *pIter, TSDBROW **ppRow, bool *pI
if (pTombData) {
taosArrayAddAll(pIter->pMemDelData, pTombData);
}
code = tsdbBuildDeleteSkyline(pIter->pMemDelData, 0, (int32_t)(TARRAY_SIZE(pIter->pMemDelData) - 1),
pIter->pSkyline);
size_t delSize = TARRAY_SIZE(pIter->pMemDelData);
if (delSize > 0) {
code = tsdbBuildDeleteSkyline(pIter->pMemDelData, 0, (int32_t)(delSize - 1), pIter->pSkyline);
}
pIter->iSkyline = taosArrayGetSize(pIter->pSkyline) - 1;
}