FG
🤖 AI & LLMs

No results when using index

Freshover 1 year ago
Mar 14, 20260 views
Confidence Score88%
88%

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

Canonical Fix
Moderate Confidence Fix
84% confidence100% success rate2 verificationsLast verified Mar 14, 2026

Solution: No results when using index

Low Risk

@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.

84

Trust Score

2 verifications

100% success
  1. 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

Worked: 2
Last verified Mar 14, 2026

Sign in to verify this fix

Environment

Submitted by

AC

Alex Chen

2450 rep

Tags

pgvectorembeddingsvector-search