Vector Databases in 2026: pgvector vs Pinecone vs Qdrant vs Weaviate vs Milvus
AI·By Islam Gamal··31 min read

Vector Databases in 2026: pgvector vs Pinecone vs Qdrant vs Weaviate vs Milvus

A hands-on 2026 comparison of the five vector databases I actually ship — pricing, latency, hybrid search, filtering, sharding, re-embed cost, and the decision tree I use in client architecture reviews.

Islam Gamal
Islam Gamal
AI · Data · Automation Engineer
TL;DR

pgvector wins for teams already on Postgres and under ~10M vectors. Qdrant is my default for standalone. Pinecone if you want zero ops and can afford it. Weaviate for schema-rich hybrid search. Milvus for billion-scale with a dedicated ops team. This is the exact matrix and decision tree I walk through in architecture reviews, plus the hidden costs (re-embed, egress, filter selectivity) that flip the winner mid-project.

Key takeaways
  • Start with pgvector — 90% of RAG apps never need to leave Postgres.
  • Hybrid search (BM25 + vector) beats pure vector search on almost every real corpus.
  • Filter selectivity, not raw ANN speed, decides p95 latency once you cross 1M docs.
  • Managed services save you a hire; self-hosted saves you $2k+/mo at scale. Do the math per year, not per month.
  • Re-embed cost is the hidden killer — pick a store that supports lazy re-index and dual-write.
  • Pick the embedding model BEFORE the store: dimension × count decides storage and often changes the winner.

Why 'just use a vector DB' is the wrong question

A vector database is a search index, not a source of truth. The interesting decisions are: which index type, how to combine with lexical search, how to filter by metadata efficiently, how to re-embed without downtime, and how to pay for the storage. This article walks the trade-offs I've hit shipping RAG across 20+ projects.

It pairs with RAG that actually works (which explains why hybrid + rerank beats pure ANN), Postgres for product engineers (the base you're extending with pgvector), evaluating LLMs and classical ML (how to know if your retriever improved), and observability for AI systems (what to trace in retrieval).

The comparison matrix (2026 production numbers)

Every column below reflects behavior at 1M vectors, 1024-dim embeddings, and hybrid queries with metadata filters, on comparable hardware. Numbers rounded from my own load tests — treat as within ±20%.

FeaturepgvectorPineconeQdrantWeaviateMilvus
Ops modelSelf-host (Postgres)Fully managedSelf-host or CloudSelf-host or CloudSelf-host, hard
Cost @ 1M vec~$25/mo~$70/mo~$30/mo~$50/mo~$40/mo (heavy)
Hybrid searchDIY (tsvector + RRF)Built-inNative (BM25 + dense)NativeVia plugin
Metadata filterSQL — anythingBasicRich payloadRich schemaBasic
Pre-filter perfExcellent (SQL planner)OKExcellent (payload index)GoodOK
p95 latency~40ms~30ms~25ms~35ms~20ms
Billion-scaleNoYesYesOKBest
MultitenantRLS (native)NamespacesCollections + payloadMulti-tenancy built-inPartitions
Learning curveEasyEasyEasyMediumHard

A quick heuristic: if your total corpus fits in RAM on a $200/mo VM, pgvector wins on total cost of ownership. Cross that line and Qdrant is my next default.

Index types you actually need to understand

The store name matters less than the index inside it. Every serious ANN store exposes some subset of:

IndexBuild timeQuery latencyRecall knobMemoryWhen to pick
Flat (brute force)ZeroO(N)100% by definitionLow< 100k vectors, or truth-set for evals
IVF-FlatFastFast at small knprobeLow1M–10M vectors, cheap infra
IVF-PQFastFastnprobe + m/nbitsVery low100M+ vectors, memory-constrained
HNSWSlow (build)Very fastefSearch, MHighDefault for < 100M with RAM
DiskANNSlowFast on SSDL, RLow RAMBillion-scale, budget-conscious

Almost all production RAG in 2026 is HNSW with efSearch tuned per query — that gets you 95%+ recall at 20ms. Move to IVF-PQ or DiskANN only when the RAM bill actually hurts.

Watch out: Recall drops silently as you scale. Freeze a 1,000-query eval set at launch and re-measure recall@10 after every re-index. Regressions of 3–5% are common and invisible without the eval.

Filter selectivity: the hidden latency killer

Once you cross ~1M docs, pure ANN speed matters less than how well the store combines a metadata filter with the vector search. Three strategies:

  1. Post-filter — run ANN, then drop rows that fail the filter. Fast if filter is loose, disastrous if filter is tight (you retrieve 10k to keep 5).
  2. Pre-filter — apply the filter first, then ANN only over the candidate set. Requires a payload index. Qdrant and Weaviate excel here.
  3. Query planner — decide per query based on estimated selectivity. pgvector gets this for free from Postgres' planner.

If your app filters by tenant, language, doc-type, and date on every query — and most do — pre-filter or planner-based stores will beat ANN-only stores by 3–10× at p95.

Hybrid search: BM25 + vector wins almost always

Pure dense search misses exact identifiers (SKUs, error codes, names) and pure BM25 misses paraphrases. Reciprocal Rank Fusion (RRF) of the two top-N lists is the boring, dominant baseline in 2026.

def rrf(bm25_hits, dense_hits, k=60, top=20):
    scores = {}
    for rank, doc_id in enumerate(bm25_hits):
        scores[doc_id] = scores.get(doc_id, 0) + 1 / (k + rank)
    for rank, doc_id in enumerate(dense_hits):
        scores[doc_id] = scores.get(doc_id, 0) + 1 / (k + rank)
    return sorted(scores, key=scores.get, reverse=True)[:top]

pgvector implements this in SQL; Qdrant and Weaviate expose it as a single query. Full pattern with reranking in RAG that actually works.

When each store shines

pgvector — the boring choice that ships

You already run Postgres. You want joins, transactions, RLS on your vectors, and a single backup story. This is the answer 60% of the time.

Pro tip: Use ivfflat for <1M vectors, hnsw above that. Always ANALYZE after bulk inserts. Add a partial index per tenant if the tenants are very unbalanced.

Qdrant — my default for standalone

Rust core, generous free self-hosted, best-in-class filter-then-search. Payload indexing means filter queries stay fast even at 100M vectors. Snapshots and rolling upgrades are painless.

Pinecone — pay to not think about ops

Fastest to production. Serverless tier auto-scales. Pricing gets loud past 10M vectors — do the annual math before committing. Weakness: metadata filtering is thinner than Qdrant/Weaviate.

Weaviate — for schema-first teams

If your RAG has real entities (Product, Author, Article) with typed relationships, Weaviate's schema shines. Built-in modules for embeddings, reranking, and multi-tenancy at scale.

Milvus — the billion-scale monster

Only pick this if you actually need it. The ops complexity is real — separate coord, query, data, index nodes; you'll want a dedicated infra engineer. See parallels in self-hosting n8n on Kubernetes for the operational overhead.

The decision tree I actually use in reviews

  1. Are you already on Postgres and under 5M vectors? → pgvector. Stop here.
  2. Do you want zero ops and have budget? → Pinecone.
  3. Do you need rich metadata filters at 10M+ scale? → Qdrant.
  4. Do you have complex typed entities and want multi-tenancy first-class? → Weaviate.
  5. Do you have >500M vectors and a dedicated ops team? → Milvus.
Watch out: Don't pick a vector DB before you've picked an embedding model. A 3072-dim model quadruples storage vs 768-dim — that math changes the winner and can double the annual bill.

Multi-tenancy: RLS, namespaces, or partitions

SaaS with per-tenant corpora needs a serious answer for isolation. Four common patterns:

  • Row-level filter — one collection, tenant_id on every vector, filter in query. Simple, cheap, risky if the filter is ever forgotten.
  • Namespace/collection per tenant — hard isolation, but ops burden grows linearly (backups, index rebuilds).
  • RLS (pgvector) — Postgres enforces at the row level. Combine with the pattern in Postgres for product engineers. This is my default for SaaS.
  • Sharding by tenant — for whales. Route large tenants to dedicated shards, keep small tenants pooled.

Re-embed without downtime

The single biggest hidden cost: re-embedding when you upgrade the model. For 100M vectors at $0.02/1M input tokens with 300-token chunks, a re-embed is ~$600 in API cost alone, plus rewrite time.

The safe pattern is dual-write with lazy read-side migration:

  1. Add a new column/collection for the new embedding.
  2. Backfill in batches with a rate limit; monitor cost live.
  3. Dual-write: every new document embeds into both old and new.
  4. Behind a feature flag, route reads to the new index for a percent of traffic.
  5. Once quality holds on the eval set, cut fully and drop the old column.

pgvector supports this trivially (just add a column). Pinecone requires a new index. Qdrant/Weaviate/Milvus support named vector fields on the same collection — plan for that from day one.

Cost math: the numbers that actually swing

Cost when re-embedding
40%
Storage from metadata
8h
Migrate 10M vectors
~$0
Cost of a reranker (huge quality win)

Also budget for network egress if you call a hosted embedder from a different region than your vector store — this quietly adds hundreds/month at scale. Route the whole read/write path in one cloud region if you can.

For attributing this to the right feature/customer, wire it into your LLM cost dashboard alongside completion costs.

Testing at scale before you commit

  1. Load 1M representative vectors with real metadata distribution.
  2. Run a 1,000-query eval set for recall@10 and NDCG@10.
  3. Load-test 100 concurrent queries with realistic filters; record p50/p95/p99.
  4. Simulate a full re-embed and time it end-to-end.
  5. Kill a node mid-query and observe recovery.

Do this before you sign a contract or commit to a self-hosted stack. Two days of load testing has saved every client I've done it for from a very expensive rewrite six months later.

What about LanceDB, Chroma, SQLite-vss, and the newcomers?

Great for prototyping and local-first apps. I don't yet run them as the primary store in production — the ecosystem around backups, monitoring, replication, and multi-tenant isolation is still thinner than the five in this guide. Revisit yearly; the gap is closing.

#Vector DB#RAG#Embeddings#pgvector#Pinecone#Qdrant#Weaviate#Milvus

Frequently asked

Can I move from pgvector to Qdrant later?

Yes — vectors are just floats. The friction is your metadata schema and query surface. Design the pipeline to write into an abstract 'index' interface from day one and swapping stores becomes a weekend job.

How do I choose an embedding dimension?

Bench recall@10 vs storage at 512, 768, 1024, and 3072 dims. In most RAG the quality plateaus around 1024 for English; multilingual sometimes benefits from higher. See the eval methodology in evaluating LLMs.

Should I store the raw text in the vector DB?

Store an id and a short snippet. Keep the source of truth in your relational store or object storage. This keeps the vector store small, portable, and cheap to re-index.

Is a reranker worth adding?

Almost always — 5–10 point quality wins at trivial cost. Retrieve 50–100 with ANN, rerank to 5–10 with a cross-encoder or a strong LLM. Details in RAG that actually works.

How do I handle deletes and updates?

pgvector — normal DELETE/UPDATE, rebuild index periodically. Qdrant/Weaviate/Milvus support tombstoning with background compaction. Pinecone: upsert on the same id. Test deletion latency early; some stores lag hours before a delete is enforced.

Building something similar?

I help teams ship production-grade AI agents, n8n workflows, and data platforms. Let's talk about what you're building.

Work with me
Islam Gamal
Written by

Islam Gamal

AI, Data & Automation Engineer. I design and ship production AI agents, n8n workflows, and cloud data platforms — with a focus on reliability, cost, and measurable business impact. Founder of Tashghil and Tek bil Arabi.

More from Islam Gamal

Browse every article by Islam Gamal on the author page.