fix(query): remove expired moving data operation during extract data from in-memory buffer.
This commit is contained in:
parent
8242cac94a
commit
b6677e1a5d
|
@ -2769,20 +2769,8 @@ static int tsdbReadRowsFromCache(STableCheckInfo* pCheckInfo, TSKEY maxKey, int
|
||||||
} while (moveToNextRowInMem(pCheckInfo));
|
} while (moveToNextRowInMem(pCheckInfo));
|
||||||
|
|
||||||
taosMemoryFreeClear(pSchema); // free the STSChema
|
taosMemoryFreeClear(pSchema); // free the STSChema
|
||||||
|
|
||||||
assert(numOfRows <= maxRowsToRead);
|
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;
|
int64_t elapsedTime = taosGetTimestampUs() - st;
|
||||||
tsdbDebug("%p build data block from cache completed, elapsed time:%" PRId64 " us, numOfRows:%d, numOfCols:%d, %s",
|
tsdbDebug("%p build data block from cache completed, elapsed time:%" PRId64 " us, numOfRows:%d, numOfCols:%d, %s",
|
||||||
pTsdbReadHandle, elapsedTime, numOfRows, numOfCols, pTsdbReadHandle->idStr);
|
pTsdbReadHandle, elapsedTime, numOfRows, numOfCols, pTsdbReadHandle->idStr);
|
||||||
|
|
|
@ -2138,16 +2138,6 @@ void doFilter(const SNode* pFilterNode, SSDataBlock* pBlock, SArray* pColMatchIn
|
||||||
blockDataUpdateTsWindow(pBlock);
|
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) {
|
void extractQualifiedTupleByFilterResult(SSDataBlock* pBlock, const int8_t* rowRes, bool keep) {
|
||||||
if (keep) {
|
if (keep) {
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Reference in New Issue