From: frapercan (@frapercan) <noreply+frapercan@github.com>
To: pgvector/pgvector <noreply+pgvector-pgvector@github.com>
Subject: [pgvector/pgvector] PR #809: docs: Add FAQ about pgvector feasibility for bulk distance calculations
Date: Wed, 26 Mar 2025 23:56:00 +0000
Message-ID: <gh-pgvector-pgvector-809@github.com> (raw)
This PR adds a frequently asked question and answer detailing why row-oriented databases such as Postgres (with pgvector) may not be optimal for massive distance computations.
inline patch 1: README.md (+4/-0 lines) download inline-1.patchdiff --git a/README.md b/README.mdindex 1ee996b94..af817528d 100644--- a/README.md+++ b/README.md@@ -881,6 +881,10 @@ No, but like other index types, you’ll likely see better performance if they d
SELECT pg_size_pretty(pg_relation_size('index_name'));
```
+#### Is it feasible to use pgvector for bulk distance calculations? ++row-oriented databases like Postgres aren’t optimized for massive distance computations. For large-scale vector operations (e.g., millions of vectors), it’s recommended to use specialized libraries that store vectors in contiguous memory and support matrix operations, as this delivers much higher performance than repeatedly calculating distances within SQL.+
## Troubleshooting
#### Why isn’t a query using an index?