From 18e83173c8c58f9edbc56b6ab45961bf3f133b1c Mon Sep 17 00:00:00 2001 From: kailixu Date: Tue, 23 May 2023 17:21:45 +0800 Subject: [PATCH 1/3] fix: delete index filter for desc query --- source/dnode/vnode/src/tsdb/tsdbRead.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/source/dnode/vnode/src/tsdb/tsdbRead.c b/source/dnode/vnode/src/tsdb/tsdbRead.c index 247bc5d0b2..1263140b1c 100644 --- a/source/dnode/vnode/src/tsdb/tsdbRead.c +++ b/source/dnode/vnode/src/tsdb/tsdbRead.c @@ -1767,6 +1767,9 @@ static bool overlapWithDelSkyline(STableBlockScanInfo* pBlockScanInfo, const SDa if (p->ts > pBlock->minKey.ts && index > 0) { index -= 1; } else { // find the first point that is smaller than the minKey.ts of dataBlock. + if (p->version == 0 && p->ts == pBlock->minKey.ts && index > 0) { + --index; + } break; } } From 82b8c3c3d1f41ff81f80db3fbad241931c5953d4 Mon Sep 17 00:00:00 2001 From: kailixu Date: Tue, 23 May 2023 18:21:21 +0800 Subject: [PATCH 2/3] fix: delete index filter for desc query --- source/dnode/vnode/src/tsdb/tsdbRead.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/dnode/vnode/src/tsdb/tsdbRead.c b/source/dnode/vnode/src/tsdb/tsdbRead.c index 1263140b1c..5637fe1eaf 100644 --- a/source/dnode/vnode/src/tsdb/tsdbRead.c +++ b/source/dnode/vnode/src/tsdb/tsdbRead.c @@ -1767,8 +1767,8 @@ static bool overlapWithDelSkyline(STableBlockScanInfo* pBlockScanInfo, const SDa if (p->ts > pBlock->minKey.ts && index > 0) { index -= 1; } else { // find the first point that is smaller than the minKey.ts of dataBlock. - if (p->version == 0 && p->ts == pBlock->minKey.ts && index > 0) { - --index; + if (p->version == 0 && p->ts == pBlock->minKey.ts) { + index -= 1; // index always larger than 0 if p->version equals 0 } break; } From ef899a0cc3cb9ff0366dc902678d109c57d4972d Mon Sep 17 00:00:00 2001 From: kailixu Date: Wed, 24 May 2023 11:28:45 +0800 Subject: [PATCH 3/3] fix: delete index filter for desc query --- source/dnode/vnode/src/tsdb/tsdbRead.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/dnode/vnode/src/tsdb/tsdbRead.c b/source/dnode/vnode/src/tsdb/tsdbRead.c index 5637fe1eaf..b4b090249e 100644 --- a/source/dnode/vnode/src/tsdb/tsdbRead.c +++ b/source/dnode/vnode/src/tsdb/tsdbRead.c @@ -1767,8 +1767,8 @@ static bool overlapWithDelSkyline(STableBlockScanInfo* pBlockScanInfo, const SDa if (p->ts > pBlock->minKey.ts && index > 0) { index -= 1; } else { // find the first point that is smaller than the minKey.ts of dataBlock. - if (p->version == 0 && p->ts == pBlock->minKey.ts) { - index -= 1; // index always larger than 0 if p->version equals 0 + if (p->ts == pBlock->minKey.ts && p->version < pBlock->maxVer && index > 0) { + index -= 1; } break; }