From: vrana (@vrana) <noreply+vrana@github.com>
To: pgvector/pgvector <noreply+pgvector-pgvector@github.com>
Subject: [pgvector/pgvector] issue #923: Bad recall with HNSW vector_ip_ops
Date: Mon, 10 Nov 2025 08:56:57 +0000
Message-ID: <gh-pgvector-pgvector-923@github.com> (raw)
PostgreSQL: 17.6
I have this index created on a populated table:
```sql
CREATE INDEX film_rating_vectors_vector_ip_idx ON film_rating_vectors USING hnsw (vector vector_ip_ops);
```
I have this query:
```sql
ORDER BY film_rating_vectors.vector <#> (SELECT vector FROM user_rating_vectors WHERE user_id = 16265)
```
Without the index, my query returns ~13k rows. With the index, it returns 4 rows (not 4k, really only 4). Sometimes, when I drop the index and recreate it then the problem is fixed. But sometimes it's not. Different machines behave differently even though they run in the same VM environment.
I didn't change the parameters like `hnsw.ef_search`. I know that the index reduces recall but 13k -> 4 seems too much. Please suggest how to debug this.