@@ -24,7 +24,6 @@ import (
24
24
"strings"
25
25
"time"
26
26
27
- "github.com/bits-and-blooms/bitset"
28
27
c "github.com/dgraph-io/dgraph/v24/tok/constraints"
29
28
"github.com/dgraph-io/dgraph/v24/tok/index"
30
29
opt "github.com/dgraph-io/dgraph/v24/tok/options"
@@ -45,7 +44,6 @@ type persistentHNSW[T c.Float] struct {
45
44
// nodeAllEdges[65443][1][3] indicates the 3rd neighbor in the first
46
45
// layer for uuid 65443. The result will be a neighboring uuid.
47
46
nodeAllEdges map [uint64 ][][]uint64
48
- visitedUids bitset.BitSet
49
47
deadNodes map [uint64 ]struct {}
50
48
}
51
49
@@ -215,9 +213,6 @@ func (ph *persistentHNSW[T]) searchPersistentLayer(
215
213
var eVec []T
216
214
improved := false
217
215
for _ , currUid := range allLayerEdges [level ] {
218
- if ph .visitedUids .Test (uint (currUid )) {
219
- continue
220
- }
221
216
if r .indexVisited (currUid ) {
222
217
continue
223
218
}
@@ -238,7 +233,6 @@ func (ph *persistentHNSW[T]) searchPersistentLayer(
238
233
currDist , currUid , filteredOut )
239
234
r .addToVisited (* currElement )
240
235
r .incrementDistanceComputations ()
241
- ph .visitedUids .Set (uint (currUid ))
242
236
243
237
// If we have not yet found k candidates, we can consider
244
238
// any candidate. Otherwise, only consider those that
@@ -366,8 +360,6 @@ func (ph *persistentHNSW[T]) SearchWithPath(
366
360
start := time .Now ().UnixMilli ()
367
361
r = index .NewSearchPathResult ()
368
362
369
- ph .visitedUids .ClearAll ()
370
-
371
363
// 0-profile_vector_entry
372
364
var startVec []T
373
365
entry , err := ph .PickStartNode (ctx , c , & startVec )
@@ -451,8 +443,6 @@ func (ph *persistentHNSW[T]) insertHelper(ctx context.Context, tc *TxnCache,
451
443
inLevel := getInsertLayer (ph .maxLevels ) // calculate layer to insert node at (randomized every time)
452
444
var layerErr error
453
445
454
- ph .visitedUids .ClearAll ()
455
-
456
446
for level := range inLevel {
457
447
// perform insertion for layers [level, max_level) only, when level < inLevel just find better start
458
448
err := ph .getVecFromUid (entry , tc , & startVec )
0 commit comments