Nearest Neighbor Indexes for Similarity Search

Vector similarity search is a game-changer in the world of search. It allows us to efficiently search a huge range of media, from GIFs to articles — with incredible accuracy in sub-second timescales for billion+ size datasets.

One of the key components to efficient search is flexibility. And for that we have a wide range of search indexes available to us — there is no ‘one-size-fits-all’ in similarity search.

This is a companion discussion topic for the original entry at

How does efConstruction have an impact on search time for IVFHNSW (as mentioned in this description)? I am observing something in my experiments but can’t figure out why.

efConstruction primarily effects your build time (eg larger efConstruction == longer build time). It has been some time since working with HNSW so take this with a pinch of salt, but if efConstruction is affecting your search times it may be that different efConstruction values create a more or less optimized graph, so search times could be slower or faster because of that. However, as far as I know there’s no direct relationship between efConstruction and search time

1 Like

Hi guys,
regarding the efConstruction parameter, I have a question about the performance graphs shown in the HNSW section. How can M be greater than efConstruction ? In my understanding of the paper algorithms 1 and 2 by Malkov and Yashumin, during the node insertion, the edges are created between the inserted node and the M (or Mmax) nearest neighbors among the efConstruction ones returned for a given layer… So it seems to me that M is always less or equal to efConstruction. Same for the efSearch parameter which is by construction less or equal to the efConstruction, the maximum possible value for M (Mmax).
Thanks for your clarification
Best regards