In an actual application, you usually need results from a particular customer, category or group of active records. Those filters can change how approximate vector search behaves. A query might finish quickly while missing some of the nearest matches that satisfy your conditions.
pgvector-filterbench runs an exact search as a reference, then tests different HNSW strategies and settings against it. You can compare how long each approach takes and how many of the exact search’s top matches it finds. That gives you something concrete to work with when adjusting the search parameters.
It also checks the query plans. PostgreSQL can choose a sequential scan, which makes a supposedly impressive HNSW result a little awkward: the index you thought you were testing wasn’t being used. The benchmark checks for that explicitly.
You can sample query vectors from your database or supply your own, then compare the standard HNSW search with strict and relaxed iterative scans. Results are written to JSON and Markdown. If you want to run it in CI, you can set thresholds so a drop in recall or unexpected index usage fails the check.
There’s a Docker demo with synthetic data if you want to see how it works before setting up a run against your own tables. The tool itself is written in Go, and prebuilt binaries are available.
The benchmark queries are read-only, although exact searches can still give the database a fair amount of work. For a larger dataset, I’d start on a replica or staging database and keep the initial test small.
Useful when you’re tuning filtered vector search and want to see what your settings actually change.