pg.ddx.io  pgvector/pgvector GitHub issues and pull requests  
help / color / mirror / Atom feed
From: rmincling (@rmincling) <noreply+rmincling@github.com>
To: pgvector/pgvector <noreply+pgvector-pgvector@github.com>
Subject: Re: [pgvector/pgvector] issue #675: Question Setting ef_search to different values does not affect number of results retrieved (Django 4.2 + PGVector + HNSW index)
Date: Mon, 16 Sep 2024 15:52:35 +0000
Message-ID: <gh-pgvector-pgvector-675-c2353302201@github.com> (raw)
In-Reply-To: <gh-pgvector-pgvector-675@github.com>
References: <gh-pgvector-pgvector-675@github.com>

ok, so here is an interesting update, regardless of what LIMIT I used, the HNSW index was NOT being used (confirmed when using EXPLAIN ANALYZE. It was using a sequential scan.

So I tried this:
```
cursor.execute("SET LOCAL enable_seqscan TO off;")
```
Resulting in the HNSW being used.

So now, when i change the value of ef_search the amount of results changes accordingly.
```
cursor.execute("SET LOCAL hnsw.ef_search = 100")
```

My next question is, I expect this vector table to have potentially 100k rows. So how do I decide if I should used HNSW index or not?



view thread (12+ messages)  latest in thread

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