From f86c8d0d6e4b926195a47cf7c168b37700dea12d Mon Sep 17 00:00:00 2001 From: Xiaoyu Wang Date: Sun, 19 Mar 2023 14:40:16 +0800 Subject: [PATCH] enh: optimize last pruning logic --- source/dnode/vnode/src/tsdb/tsdbCacheRead.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/dnode/vnode/src/tsdb/tsdbCacheRead.c b/source/dnode/vnode/src/tsdb/tsdbCacheRead.c index ac0eb697fc..ad93cc567c 100644 --- a/source/dnode/vnode/src/tsdb/tsdbCacheRead.c +++ b/source/dnode/vnode/src/tsdb/tsdbCacheRead.c @@ -408,7 +408,7 @@ int32_t tsdbRetrieveCacheRows(void* pReader, SSDataBlock* pResBlock, const int32 } if (hasNotNullRow) { - if (INT64_MAX == totalLastTs || totalLastTs < singleTableLastTs) { + if (INT64_MAX == totalLastTs || (INT64_MAX != singleTableLastTs && totalLastTs < singleTableLastTs)) { totalLastTs = singleTableLastTs; } double cost = (taosGetTimestampUs() - st) / 1000.0;