Skip to content

Commit

Permalink
MB-62230 - More pre-filtering optimisations (#275)
Browse files Browse the repository at this point in the history
Use AddMany() when populating cluster assignment map with vectors
belonging to a cluster.
  • Loading branch information
metonymic-smokey authored Oct 30, 2024
1 parent ef2b41d commit 30a47cd
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion faiss_vector_posting.go
Original file line number Diff line number Diff line change
Expand Up @@ -425,9 +425,11 @@ func (sb *SegmentBase) InterpretVectorIndex(field string, requiresFiltering bool
if _, exists := centroidVecIDMap[centroidID]; !exists {
centroidVecIDMap[centroidID] = roaring.NewBitmap()
}
vecIDsUint32 := make([]uint32, 0, len(vecIDs))
for _, vecID := range vecIDs {
centroidVecIDMap[centroidID].Add(uint32(vecID))
vecIDsUint32 = append(vecIDsUint32, uint32(vecID))
}
centroidVecIDMap[centroidID].AddMany(vecIDsUint32)
}

// Getting the vector IDs corresponding to the eligible
Expand Down

0 comments on commit 30a47cd

Please sign in to comment.