From: fanfuxiaoran (@fanfuxiaoran) <noreply+fanfuxiaoran@github.com>
To: pgvector/pgvector <noreply+pgvector-pgvector@github.com>
Subject: Re: [pgvector/pgvector] issue #259: Understanding HNSW + filtering
Date: Thu, 14 Sep 2023 07:49:00 +0000
Message-ID: <gh-pgvector-pgvector-259-c1718938653@github.com> (raw)
In-Reply-To: <gh-pgvector-pgvector-259@github.com>
References: <gh-pgvector-pgvector-259@github.com>
@jkatz I found a page that proposed some methods to deal with `attribute filter ` https://www.cs.purdue.edu/homes/csjgwang/pubs/SIGMOD21_Milvus.pdf
I just have a rough idea: If there is any index on the attribute, we can first search the attribute and get a TID bitmap,
then use the bitmap to do a vector search. The bitmap can be used to filter vector items in the index, and the vector search doesn't stop until it finds enough neighbors. But it is tough, the vector index needs to sort the result and doesn't know how many dead tuples and how many target rows need to return, so it actually doesn't know when to stop searching neighbors.