Vector Search: Qdrant vs pgvector, and When the Database You Have Is Enough

Retrieval systems need somewhere to store embeddings and something to search them. Two options dominate small and mid-size deployments: a dedicated vector database, and an extension that adds vector indexes to a relational database already in use.

This comparison is about architecture and operational cost, based on documentation and published benchmark ranges. No index was built for it, and throughput figures vary enough with hardware and settings that a reader should measure on their own corpus.

The two designs

Property Dedicated vector engine Vector extension in a relational database
Setup Another service to run, monitor, back up An extension in the database already running
Filtering Native, with payload indexes SQL predicates, exact and familiar
Transactions Limited, per-collection semantics Full ACID across vectors and rows
Scaling Sharding and replication built for vectors Scales as the database scales
Operational familiarity New tooling, new failure modes Existing tooling, existing backups

The filter problem decides most cases

Real retrieval is rarely a pure nearest-neighbour search; it is a filtered search: this user’s documents, this date range, this access level. A dedicated engine handles filters with pre-filtering and payload indexes tuned for it. A relational database handles filters with a WHERE clause, which can be exact and can also force a scan.

The behaviour to check is how the system behaves when the filter is highly selective. A filter that matches one percent of rows changes the search into a scan in some implementations and is handled efficiently in others. Test with your own selectivity, not with a demo dataset.

Transactions and consistency

If embeddings must stay consistent with the source rows — a document updated, its vectors replaced, in one atomic step — the relational option is far simpler. Doing it across two systems requires a queue and an idempotent writer, and the queue is another component to monitor.

For a pipeline that re-embeds documents nightly, eventual consistency is acceptable and the two-system approach is fine. For a system where a stale vector produces a wrong answer immediately, atomicity is worth the constraints.

Operational surface, the hidden cost

Every additional service is another thing to back up, upgrade, monitor, and secure. A vector engine adds a component with its own version cadence and its own failure modes; an extension adds a schema migration and a version compatibility concern.

Count the services in the deployment before adding one. Teams routinely underestimate the cost of a new service at ten hours per month, which over a year is more than the performance difference is worth for a corpus of a few hundred thousand chunks.

Where the dedicated engine wins

Above a few million vectors, with heavy filtering and high query rates, purpose-built indexes and sharding pay for themselves. Quantisation support, hybrid search with sparse vectors, and multi-tenant collections are features that a relational extension does not attempt.

If the roadmap includes multiple embedding models per collection, or per-tenant isolation at scale, the dedicated engine is the architecture that will not need replacing.

Where the extension wins

Up to a few hundred thousand chunks, with modest query rates and a need for transactional consistency with existing tables, the extension is the pragmatic choice: one system, one backup, one set of credentials, and SQL for everything.

Most research and small-team retrieval systems live comfortably in that range for years, and migrating to a dedicated engine later is a contained piece of work if the embedding pipeline is already separate from storage.

The migration path, designed early

Keep the embedding pipeline writing to a table with a stable schema and the vector column isolated, and moving to another engine becomes an export and an import rather than a rewrite. Keep the query interface behind a function so the call sites do not depend on either system’s dialect.

That discipline costs an hour at the start and saves weeks if the decision has to be revisited, which it usually is once the corpus grows.

The verdict

Start with the extension if a relational database is already running and the corpus is under a few hundred thousand chunks. Move to a dedicated engine when filtering, scale, or multi-tenancy becomes the constraint rather than the storage location.

Both are reasonable; the failure is adopting the dedicated engine for a corpus that fits in one table, and paying operational rent for capability that is never used.

Index parameters that change everything

Both approaches expose parameters that trade recall against speed and memory: graph breadth, build effort, and the number of candidates examined. Defaults are tuned for demonstration datasets, and real corpora often need different values.

Measure recall at ten against an exact search on a thousand queries, then tune until recall is acceptable and latency is tolerable. That measurement takes an afternoon and replaces every benchmark table, including the one above.

Backups and reindexing

A vector index can be rebuilt from source documents if the embedding pipeline is deterministic and versioned. That makes the index disposable, which simplifies backups enormously: back up the source and the pipeline, not the index.

Keep the embedding model version in the document metadata. Without it, a reindex silently mixes vectors from two models, and the retrieval quality degrades in a way that is very hard to diagnose.

The five-year view

Storage choices outlive most of the software around them. A schema that separates source text, metadata, and vectors lets the engine be replaced without touching the pipeline, and that separation is worth more than any performance advantage at the scale most teams operate.

Design for replacement and the choice becomes reversible; design around one engine and the choice becomes a five-year commitment made in an afternoon.

Choosing on the size of the team, not the size of the corpus

A team of one should almost always start with whatever database is already running; the operational savings compound daily. A team with a dedicated platform engineer can afford a second service and the capability that comes with it.

The corpus size argument is usually premature. The operational capacity argument is rarely premature, and it is the one that predicts whether the system will still be running in two years.

What this review could not verify

No latency or recall measurements were taken here. Published benchmark ranges differ by hardware, index parameters, and filter selectivity. The decisive test is a thousand real queries against both systems on the actual corpus, measured at the filter selectivity the application uses.

Photo: Jacek Halicki, via Wikimedia Commons (CC BY-SA 4.0).

Leave a Comment