From c0ee25afd8e2426548a7b49fdb604046edd007ff Mon Sep 17 00:00:00 2001 From: congqixia Date: Fri, 9 Aug 2024 07:52:22 +0800 Subject: [PATCH] fix: Use k locations only for basic BF test location (#35380) Related to #35379 Signed-off-by: Congqi Xia --- internal/storage/pk_statistics.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/storage/pk_statistics.go b/internal/storage/pk_statistics.go index 35649ae46f..f984583e75 100644 --- a/internal/storage/pk_statistics.go +++ b/internal/storage/pk_statistics.go @@ -228,7 +228,7 @@ func (lc *BatchLocationsCache) Locations(k uint, bfType bloomfilter.BFType) [][] }) } - return lc.basicLocations + return lo.Map(lc.basicLocations, func(locations []uint64, _ int) []uint64 { return locations[:k] }) case bloomfilter.BlockedBF: // for block bf, we only need cache the hash result, which is a uint and only compute once for any k value if len(lc.blockLocations) != len(lc.pks) {