pg.ddx.io  pgvector/pgvector GitHub issues and pull requests  
help / color / mirror / Atom feed
From: williamhakim10 (@williamhakim10) <noreply+williamhakim10@github.com>
To: pgvector/pgvector <noreply+pgvector-pgvector@github.com>
Subject: Re: [pgvector/pgvector] issue #259: Understanding HNSW + filtering
Date: Tue, 05 Mar 2024 16:31:54 +0000
Message-ID: <gh-pgvector-pgvector-259-c1979171781@github.com> (raw)
In-Reply-To: <gh-pgvector-pgvector-259@github.com>
References: <gh-pgvector-pgvector-259@github.com>

The flow-chart by @lambda-science is relatively easy to implement by simply writing your own logic; just slightly modify your query to force the planner to brute-force depending on the scenario. For example, you can do something like this to force brute-force:
```
select 1 - (embedding <=> {your embedding}) cosine_similarity
...
order by cosine_similarity desc
```
The real issue isn't forcing the query planner to use brute force in situations in which you already know ANN will return <K results, it's that brute force isn't realistic once you start getting to hundreds of millions of vectors within a reasonable time frame.

view thread (90+ messages)  latest in thread

Message-ID: <gh-pgvector-pgvector-259-c1979171781@github.com>
Permalink:  ../gh-pgvector-pgvector-259-c1979171781@github.com/

 · 


This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox