From 521283b2be762c1ce8f5991f39bab0a0a8641fd8 Mon Sep 17 00:00:00 2001 From: Alex Duan <417921451@qq.com> Date: Thu, 15 Sep 2022 14:50:36 +0800 Subject: [PATCH] fix(query): need not load block if window include block completely --- src/query/src/qExecutor.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/query/src/qExecutor.c b/src/query/src/qExecutor.c index 05831b8dff..ee437511a7 100644 --- a/src/query/src/qExecutor.c +++ b/src/query/src/qExecutor.c @@ -3047,6 +3047,11 @@ static bool overlapWithTimeWindow(SQueryAttr* pQueryAttr, SDataBlockInfo* pBlock ekey = taosTimeAdd(ekey, pQueryAttr->interval.sliding, pQueryAttr->interval.slidingUnit, pQueryAttr->precision); else ekey += pQueryAttr->interval.sliding; + // not in range sk~ek, break + if (!(ekey >= sk && ekey <= ek)) { + break; + } + // get align getAlignQueryTimeWindow(pQueryAttr, ekey, sk, ek, &w); } @@ -3056,7 +3061,7 @@ static bool overlapWithTimeWindow(SQueryAttr* pQueryAttr, SDataBlockInfo* pBlock break; } - // window start point in block window ragne return true + // window start point in block window range return true if (w.skey >= pBlockInfo->window.skey && w.skey <= pBlockInfo->window.ekey) { return true; } -- GitLab