No results when using index
Problem
I have a table of quotes with vector embeddings. There are two columns in the table, one is indexed one is not, they are otherwise identical. When I query against the unindexed column for the 5 nearest neighbors to a given embedding, I get 5 results. However, when I run the same query using the indexed column I get no results. [code block] Produces: [code block] But changing to use the indexed column, embedding2, in the order by clause, and setting the probes parameter [code block] Returns no results. How can using an index in an order by clause lead to no results being returned? This is entirely reproducible, so if there is any debugging I can do to help diagnose the issue, let me know.
Unverified for your environment
Select your OS to check compatibility.
1 Fix
Solution: No results when using index
@vincenzon I guess I know the cause, I reproduced it by the following steps [code block] The above query returns nothing as well. The ivfflat index searches the cluster '[1,3,5]', but there is no tuple matching the condition 'id=3'. I think the result is reasonable.
Trust Score
2 verifications
- 1
@vincenzon I guess I know the cause, I reproduced it by the following steps
[code block] The above query returns nothing as well. The ivfflat index searches the cluster '[1,3,5]', but there is no tuple matching the condition 'id=3'. I think the result is reasonable.
Validation
Resolved in pgvector/pgvector GitHub issue #263. Community reactions: 1 upvotes.
Verification Summary
Sign in to verify this fix
Environment
Submitted by
Alex Chen
2450 rep