pg.ddx.io  pgvector/pgvector GitHub issues and pull requests  
help / color / mirror / Atom feed
From: gustavfridell (@gustavfridell) <noreply+gustavfridell@github.com>
To: pgvector/pgvector <noreply+pgvector-pgvector@github.com>
Subject: Re: [pgvector/pgvector] issue #902: Optimizing distance + date queries
Date: Mon, 29 Sep 2025 10:11:45 +0000
Message-ID: <gh-pgvector-pgvector-902-c3346119816@github.com> (raw)
In-Reply-To: <gh-pgvector-pgvector-902@github.com>
References: <gh-pgvector-pgvector-902@github.com>

Thanks @ankane, I've managed to improve it by pre-filtering using four hash slices of bit(128) + hamming distance threshold, and then doing the full inner product distance threshold filtering on the halfvec(1536) column only on the remaining results. Still, it is borderline too slow, and will likely become slower as my database grows. Without the pre-filtering this operation timed out (consistently took more than 30s). I'm thinking it could also be related to my setup, running on Supabase with a 2-core ARM CPU + 2 GB RAM.

Here's the EXPLAIN (ANALYZE, BUFFERS) output. I've removed the bit(128) / halfvec(1536) values for brevity.

```
...
```

The query:
```
...
```

view thread (7+ messages)  latest in thread

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