From 2fc2fb16360cef7e894f258f0c80e600a67c3c6c Mon Sep 17 00:00:00 2001 From: hjxilinx Date: Sun, 15 Mar 2020 14:43:30 +0800 Subject: [PATCH] support the interpolation search --- src/system/detail/inc/vnodeRead.h | 1 + src/system/detail/src/vnodeQueryImpl.c | 3 +++ 2 files changed, 4 insertions(+) diff --git a/src/system/detail/inc/vnodeRead.h b/src/system/detail/inc/vnodeRead.h index 46b0d5d7b7..ef3b6b6e04 100644 --- a/src/system/detail/inc/vnodeRead.h +++ b/src/system/detail/inc/vnodeRead.h @@ -191,6 +191,7 @@ typedef struct SQueryRuntimeEnv { SPointInterpoSupporter* pInterpoSupporter; bool hasTimeWindow; + bool interpoSearch; } SQueryRuntimeEnv; /* intermediate pos during multimeter query involves interval */ diff --git a/src/system/detail/src/vnodeQueryImpl.c b/src/system/detail/src/vnodeQueryImpl.c index 0396192b5c..a5df289449 100644 --- a/src/system/detail/src/vnodeQueryImpl.c +++ b/src/system/detail/src/vnodeQueryImpl.c @@ -3450,6 +3450,9 @@ static bool loadPrevDataPoint(SQueryRuntimeEnv* pRuntimeEnv, char** result) { qTrace("QInfo:%p get prev data point, fileId:%d, slot:%d, pos:%d, pQuery->pos:%d", GET_QINFO_ADDR(pQuery), pQuery->fileId, pQuery->slot, pQuery->pos, pQuery->pos); + + // restore to the start position + loadRequiredBlockIntoMem(pRuntimeEnv, &pRuntimeEnv->startPos); } else { // moveToNextBlock make sure there is a available cache block, if exists assert(vnodeIsDatablockLoaded(pRuntimeEnv, pMeterObj, -1, true) == DISK_BLOCK_NO_NEED_TO_LOAD); -- GitLab