From b6677e1a5d9ba4cce15033e781bb6e148b8aed93 Mon Sep 17 00:00:00 2001 From: Haojun Liao Date: Sat, 14 May 2022 22:13:27 +0800 Subject: [PATCH] fix(query): remove expired moving data operation during extract data from in-memory buffer. --- source/dnode/vnode/src/tsdb/tsdbRead.c | 12 ------------ source/libs/executor/src/executorimpl.c | 10 ---------- 2 files changed, 22 deletions(-) diff --git a/source/dnode/vnode/src/tsdb/tsdbRead.c b/source/dnode/vnode/src/tsdb/tsdbRead.c index b293f1399d..927babc26c 100644 --- a/source/dnode/vnode/src/tsdb/tsdbRead.c +++ b/source/dnode/vnode/src/tsdb/tsdbRead.c @@ -2769,20 +2769,8 @@ static int tsdbReadRowsFromCache(STableCheckInfo* pCheckInfo, TSKEY maxKey, int } while (moveToNextRowInMem(pCheckInfo)); taosMemoryFreeClear(pSchema); // free the STSChema - assert(numOfRows <= maxRowsToRead); - // if the buffer is not full in case of descending order query, move the data in the front of the buffer - if (!ASCENDING_TRAVERSE(pTsdbReadHandle->order) && numOfRows < maxRowsToRead) { - int32_t emptySize = maxRowsToRead - numOfRows; - - for (int32_t i = 0; i < numOfCols; ++i) { - SColumnInfoData* pColInfo = taosArrayGet(pTsdbReadHandle->pColumns, i); - memmove((char*)pColInfo->pData, (char*)pColInfo->pData + emptySize * pColInfo->info.bytes, - numOfRows * pColInfo->info.bytes); - } - } - int64_t elapsedTime = taosGetTimestampUs() - st; tsdbDebug("%p build data block from cache completed, elapsed time:%" PRId64 " us, numOfRows:%d, numOfCols:%d, %s", pTsdbReadHandle, elapsedTime, numOfRows, numOfCols, pTsdbReadHandle->idStr); diff --git a/source/libs/executor/src/executorimpl.c b/source/libs/executor/src/executorimpl.c index cb8bee1e6a..2cbfb9b344 100644 --- a/source/libs/executor/src/executorimpl.c +++ b/source/libs/executor/src/executorimpl.c @@ -2138,16 +2138,6 @@ void doFilter(const SNode* pFilterNode, SSDataBlock* pBlock, SArray* pColMatchIn blockDataUpdateTsWindow(pBlock); } -static int32_t colIdSearchCompar(const void* p1, const void* p2) { - int32_t colId = *(int32_t*)p1; - SColMatchInfo* pInfo = (SColMatchInfo*)p2; - if (colId == pInfo->targetSlotId) { - return 0; - } - - return (colId < pInfo->colId) ? -1 : 1; -} - void extractQualifiedTupleByFilterResult(SSDataBlock* pBlock, const int8_t* rowRes, bool keep) { if (keep) { return; -- GitLab