Vector Database vs. pgvector: Do You Actually Need a Dedicated One?

Short answer: If you're already running PostgreSQL and have under roughly 10 million vectors, pgvector is enough — it's a Postgres extension, not a new piece of infrastructure. Reach for a dedicated vector database (Qdrant, Weaviate, or Pinecone) only once your corpus genuinely outgrows one Postgres instance, native hybrid search or multi-tenant isolation is core to the product, or you want a vendor to own the operational burden instead of you.
What this means for you
- Already on Postgres, corpus under ~10M vectors → add the pgvector extension, not a new database.
- Need hybrid (keyword + semantic) search as a first-class feature, not a bolt-on → Weaviate or Qdrant are built for it.
- Want zero ops and can accept managed-only, closed-source hosting → Pinecone.
- Getting bad answers from retrieval? That's almost always chunking and evaluation, not the database.
The usual sequence is backwards. A team builds a RAG feature, reads that "you need a vector database," and provisions Pinecone or Weaviate before checking whether the Postgres instance already running the rest of the product can do the job. That's an extra system to deploy, monitor, back up, and pay for — before anyone has confirmed it was necessary. If you haven't settled the broader question of how your AI feature should be built at all, start with RAG vs. fine-tuning; this post assumes you've landed on retrieval and are now choosing where the vectors live.
What pgvector actually is
pgvector isn't a competing database. Its own GitHub README describes it plainly: an open-source extension that adds a vector data type and HNSW and IVFFlat index types to PostgreSQL. You install it into a database you already run, add a column, build an index, and query it with ordinary SQL — joined against the rest of your schema, inside the same transactions, behind the same row-level security you already have.
That has real limits. The vector type caps out at 2,000 dimensions; the lower-precision halfvec type raises that to 4,000. HNSW builds a multilayer graph that the README says trades slower, more memory-hungry builds for better speed-recall than the older IVFFlat method, and it doesn't need a training step, so you can create the index before the table has data. Filters apply after the index scan, so a highly selective WHERE tenant_id = 42 can still cost you recall unless you address it with partitioning or iterative scans. None of this is exotic — it's the normal shape of running a feature on a database you already operate, with the normal tradeoffs that come with it.
The signals that say pgvector is enough
- You're already on Postgres. There's no new system to provision, secure, or keep patched. Your existing backups, monitoring, and access controls already cover it.
- Your corpus is comfortably under the point where index size becomes the bottleneck. pgvector's documentation doesn't publish a hard row-count ceiling — the real constraint is whether the index fits in available memory and how selective your filters are. Most practical guidance treats corpora under roughly 10 million vectors as comfortable on a reasonably provisioned Postgres instance.
- Hybrid search is a nice-to-have, not the product. You can combine pgvector with Postgres's full-text search, but you're wiring that yourself rather than getting it as a built-in.
- You need growth room, not a rewrite. The pgvector README itself points to read replicas, Citus, or PgDog for scaling the underlying Postgres horizontally — options that exist before you'd need to migrate off it entirely.
The signals that say you've outgrown it
- Scale that's actually large — hundreds of millions of vectors or sustained query volume high enough that the index no longer comfortably fits in memory on instances you're willing to run.
- Hybrid search as a first-class product feature. Weaviate's own documentation highlights combining BM25 keyword search with vector search as a headline capability; Qdrant natively fuses dense and sparse vectors. Both are built around that combination rather than treating it as an add-on.
- Multi-tenant isolation at scale is core to the architecture. Weaviate describes built-in multi-tenancy and replication as production-readiness features, not something you'd otherwise build by hand across many Postgres schemas.
- You want a vendor to own uptime, scaling, and ops and are willing to accept managed-only, closed-source hosting and its cost model in exchange.
Comparing the usual next step
| Pinecone | Qdrant | Weaviate | |
|---|---|---|---|
| Hosting / license | Managed cloud only, closed-source | Apache 2.0 — self-host free, or managed Qdrant Cloud | Mostly BSD-3-Clause — self-host or managed; one module is separately licensed |
| Hybrid search | Supported | Native dense + sparse fusion | Native BM25 + vector — most mature of the three at this specifically |
| Scaling model | Fully managed by the vendor | Sharding and replication, self-managed or via their cloud | Built-in multi-tenancy plus replication |
| Best fit | Want zero ops, can accept vendor lock-in | Self-hosting, cost control, or portability matter | Hybrid search or multi-tenant SaaS is core to the product |
Each of the three is a reasonable choice for the thing it's built around. None of them is automatically "the" vector database — the fit depends on whether you need to self-host, whether hybrid search is a feature or the whole point, and how much operational work you're willing to take on yourself.
What actually breaks RAG — and it's rarely the database
Teams that migrate from pgvector to a dedicated store expecting better answers are often disappointed, because answer quality mostly isn't a storage-layer problem. It comes from how documents are chunked, which embedding model is used and whether it fits the domain, and whether retrieval is actually measured rather than assumed to be working. Our LLM evaluation guide covers how to build a golden set and test retrieval before and after shipping changes — that's the step that catches bad chunking and stale embeddings, and no vector database does it for you. A faster or fancier index returns bad chunks faster; it doesn't make them good chunks.
A simple decision framework
- Are you already on Postgres, and is your corpus under roughly 10 million vectors? If yes, add pgvector. Don't stand up a new system to solve a problem your current one can already handle.
- Is hybrid search or multi-tenant isolation actually core to the product — not a feature you might want someday, but something customers are asking for now? If yes, evaluate Weaviate or Qdrant on your own data before committing.
- Do you want to hand database ops to a vendor and are you comfortable with managed-only, closed-source hosting and its pricing model? If yes, Pinecone fits; if self-hosting or portability matters, it's the wrong choice regardless of how convenient it looks at first.
Most teams never clear the first question. If you're not sure where your own data lands, the honest first move is to measure — count what you actually have, profile your filters, and check whether the index fits in the memory you're willing to provision — before adding a second database to operate.
If you're building or extending an AI feature and want a second opinion on where the vectors should live, that's part of what we scope during AI integration work — timeline and cost depend on your existing stack and data volume, and get set during discovery rather than guessed up front.
Frequently asked questions
Is pgvector a vector database?
Not technically. pgvector is an open-source PostgreSQL extension — its own README describes it as adding a vector data type plus HNSW and IVFFlat index types to a Postgres database you already run. You get a new column type and index, not a new service to deploy, back up, or secure separately.
How many vectors can pgvector handle before performance suffers?
pgvector's own documentation doesn't publish a universal row-count cutoff. The real constraints are whether the HNSW index fits in memory, how selective your filters are, and the recall you're willing to accept — the README notes the index performs better in memory but doesn't require it. Most practical guidance treats corpora under roughly 10 million vectors on Postgres as comfortable. Benchmark your own data and filters before committing either way.
Which is better for hybrid search: Qdrant, Weaviate, or Pinecone?
Weaviate's own documentation lists combining semantic search with BM25 keyword search as a headline feature, and it's the most mature of the three at that specific job. Qdrant's GitHub page says it supports dense vectors for semantic similarity and sparse vectors for full-text search natively. Pinecone supports hybrid search too, but it's a managed-only, closed-source service — you can't self-host it. If native hybrid search is central to the product, Weaviate or Qdrant are built around it from the ground up.
Will switching to a dedicated vector database fix bad RAG answers?
Usually not by itself. Retrieval quality mostly comes down to chunking strategy, embedding model choice, and whether you're actually measuring retrieval accuracy rather than assuming it — see our guide on LLM evaluation. A dedicated store adds scale, filtering, and features like native hybrid search; it doesn't automatically make the answers better.
How long does it take to add vector search to an existing app?
It depends on whether you're adding the pgvector extension to a Postgres database you already operate or standing up a new system, how many documents need chunking and embedding, and whether you need an ongoing re-indexing pipeline to keep the index fresh. That scope is set during discovery — a few thousand static documents is a different project from a catalog that updates constantly.
Sources
- pgvector — open-source vector similarity search for Postgres — pgvector is a PostgreSQL extension (not a separate database) adding a vector type and HNSW/IVFFlat indexes. Dimension limits (2,000 for vector, 4,000 for halfvec), index memory behavior, and horizontal scaling pointers (replicas, Citus, PgDog) are documented in the project's own README.
- Qdrant — vector database and search engine — Confirms Qdrant is Apache 2.0 licensed with no feature gating on self-hosted installs, supports dense and sparse vectors for hybrid search with fusion strategies, and scales horizontally via sharding and replication.
- Weaviate — open-source vector database — Confirms most of Weaviate is BSD-3-Clause licensed (with a separately licensed commercial module), lists combining BM25 keyword search with vector search as a headline feature, and describes built-in multi-tenancy and replication for production scaling.
Need help putting this into practice?
Tech Programmer builds and ships this work for startups and enterprises. Tell us what you are trying to do and we will tell you what it takes.
Related reading
- Structured Output vs Free Text: When Should an LLM Return JSON?Free text is the right model output when a person reads the answer. A JSON schema is the right output when your code must parse fields and pass them to a UI, a database, or another API. JSON mode only promises that the text parses as JSON. Structured outputs go further and constrain the model to a schema. Neither one makes the values true. Check refusals and truncated responses, then test the fields the way you test any other AI feature.
- MCP vs Custom API Integration: When Should an AI Agent Use Each?The Model Context Protocol (MCP) is an open standard so AI applications can discover and call tools, data, and prompts through a shared server. A custom API or in-process tool call is code your product owns: smaller tool lists, per-user auth, and tighter control. Prefer custom tools when one product agent is the only caller. Prefer MCP when several clients — Claude, ChatGPT, an IDE, an internal copilot — must reuse the same capabilities. A practical path is to ship the domain API first, then add a thin MCP server once a second real client appears.
- LLM Evaluation: How to Test AI Features Before (and After) They ShipLLM evaluation measures whether your AI application behaves as intended on realistic inputs — correctness, faithfulness, safety, and task success — not whether the text sounds fluent. Start with traces and a small golden set, combine deterministic checks with calibrated LLM-as-a-judge, gate prompt and model changes in CI, and keep production failures feeding the next regression suite.