Skip to content

Commit

Permalink
Revert "MB-60943 - Add a coarse quantiser to the IVF indexes (#225)" (#…
Browse files Browse the repository at this point in the history
…232)

On account of a regression showcased with MB-61470.

This reverts commit 9e2514f.
  • Loading branch information
abhinavdangeti committed Apr 10, 2024
1 parent 9e2514f commit 91a5e17
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions section_faiss_vector_index.go
Original file line number Diff line number Diff line change
Expand Up @@ -350,8 +350,8 @@ func (v *vectorIndexOpaque) mergeAndWriteVectorIndexes(sbs []*SegmentBase,

nvecs := len(finalVecIDs)

// index type to be created after merge based on the number of vectors
// in indexData added into the index and chosen optimization.
// index type to be created after merge based on the number of vectors in
// indexData added into the index.
nlist := determineCentroids(nvecs)
indexDescription, indexClass := determineIndexToUse(nvecs, nlist)

Expand Down Expand Up @@ -458,11 +458,14 @@ const (
// Returns a description string for the index and quantizer type
// and an index type.
func determineIndexToUse(nvecs, nlist int) (string, int) {
if nvecs < 1000 {
switch {
case nvecs >= 10000:
return fmt.Sprintf("IVF%d,SQ8", nlist), IndexTypeIVF
case nvecs >= 1000:
return fmt.Sprintf("IVF%d,Flat", nlist), IndexTypeIVF
default:
return "IDMap2,Flat", IndexTypeFlat
}

return fmt.Sprintf("IVF%d_HNSW32,SQ8", nlist), IndexTypeIVF
}

func (vo *vectorIndexOpaque) writeVectorIndexes(w *CountHashWriter) (offset uint64, err error) {
Expand Down

0 comments on commit 91a5e17

Please sign in to comment.