optimize duplicate timestamp check

This commit is contained in:
Ganlin Zhao 2023-05-09 15:05:41 +08:00
parent 4693c22970
commit e1140d4c15
1 changed files with 5 additions and 1 deletions

View File

@ -176,6 +176,10 @@ static bool checkDuplicateTimestamps(STimeSliceOperatorInfo* pSliceInfo, SColumn
int64_t currentTs = *(int64_t*)colDataGetData(pTsCol, curIndex); int64_t currentTs = *(int64_t*)colDataGetData(pTsCol, curIndex);
if (currentTs > pSliceInfo->win.ekey) {
return false;
}
if ((pSliceInfo->prevTsSet == true) && (currentTs == pSliceInfo->prevTs)) { if ((pSliceInfo->prevTsSet == true) && (currentTs == pSliceInfo->prevTs)) {
return true; return true;
} }
@ -183,7 +187,7 @@ static bool checkDuplicateTimestamps(STimeSliceOperatorInfo* pSliceInfo, SColumn
pSliceInfo->prevTsSet = true; pSliceInfo->prevTsSet = true;
pSliceInfo->prevTs = currentTs; pSliceInfo->prevTs = currentTs;
if (curIndex < rows - 1) { if (currentTs == pSliceInfo->win.ekey && curIndex < rows - 1) {
int64_t nextTs = *(int64_t*)colDataGetData(pTsCol, curIndex + 1); int64_t nextTs = *(int64_t*)colDataGetData(pTsCol, curIndex + 1);
if (currentTs == nextTs) { if (currentTs == nextTs) {
return true; return true;