pg.ddx.io  pgvector/pgvector GitHub issues and pull requests  
help / color / mirror / Atom feed
From: prathier (@prathier) <noreply+prathier@github.com>
To: pgvector/pgvector <noreply+pgvector-pgvector@github.com>
Subject: [pgvector/pgvector] issue #719: SELECT WHERE ORDER BY LIMIT no results
Date: Tue, 26 Nov 2024 14:39:27 +0000
Message-ID: <gh-pgvector-pgvector-719@github.com> (raw)

Hello,

This kind of queries no longer works on my database which has more rows than before:

```
SELECT
  	(v.embedding <#> '[-0.033441752, ...0.012570631]') as distance
FROM vector_table v
LEFT JOIN files f ON f.id = v.file_id
WHERE f.type = 'MYTYPE' AND f.status = 'PROCESSED'
ORDER BY distance
LIMIT 10;
```

If I increase hnsw.ef_search from 100 to 1000 it works but it's slower. And I suppose that 1000 will not be enough when my table will be bigger.

For now I have 7 millions rows but I will reach billion rows soon.
 
Here is my index:
```
CREATE INDEX IF NOT EXISTS vector_table_embedding_idx 
ON vector_table USING hnsw ((embedding::halfvec(512)) halfvec_ip_ops)
WITH (m = 32, ef_construction = 200);
```

7 millions rows looks very small to me, is there a way to have a query correctly working without partioning or sharding my database ?



view thread (31+ messages)  latest in thread

Message-ID: <gh-pgvector-pgvector-719@github.com>
Permalink:  ../gh-pgvector-pgvector-719@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