
On this page
- Why do so many teams suddenly want a vector database?
- Can Postgres be your vector database?
- What does a dedicated vector database actually buy you?
- Is vector search the slow part of a RAG request?
- What does a separate vector store really cost?
- How do you decide whether you need a vector database?
- What should most teams do instead?
- Questions people ask
The word “embeddings” shows up in a planning doc, and within a sentence or two someone has added a vector database to the architecture. It’s a familiar pattern: RAG gets mentioned, a box labeled Pinecone or Chroma appears on the diagram, and nobody asks whether it needs to be there. It just arrives, the way a queue or a search cluster used to.
The reflex makes sense on the surface. Vectors feel new and specialized, so they seem to want a new and specialized home. And the dedicated tools are good: Pinecone, Qdrant, Weaviate and Milvus are real, well-built systems that earn their place at the scale they’re designed for.
Here’s the narrower claim: plenty of teams adding a vector database don’t have a vector problem yet. If what you have is a few hundred thousand embeddings, a Postgres instance already running, and a reflex, then at that scale the database you already operate can very likely do this job, and the point where it stops being enough sits much further out than the instinct to add a second system suggests. This isn’t a “you never need a vector database” argument. It’s a “check first” argument, and the check is cheap. The same was true for search, queues and JSONB, which Postgres does more than you think walks through one by one.
Why do so many teams suddenly want a vector database?
Often because the tutorials told them to, not because their workload demands it. Many RAG walkthroughs start with a dedicated store, many reference architectures include a vector database box, and “vector” sounds different enough from “database” that reusing the one you already have feels like a hack rather than the obvious move.
The reflex is narrative-driven. When tutorial after tutorial reaches for a dedicated store in step one, it quietly teaches a generation of engineers that this is simply how it’s done. Is that a vector problem, or a habit?
Run the arithmetic for a launch-sized corpus. Three hundred thousand 1,536-dimension embeddings is about 1.8 GB of raw vectors (300,000 × 1,536 × 4 bytes), small enough to sit in memory on a modest instance. A dedicated store sized for a scale the product hasn’t reached isn’t a bad tool. It’s bad timing.
So the problem isn’t the dedicated systems. It’s sequencing. Reaching for one in step one means taking on a second system before you’ve measured whether the first one falls short. What would it cost to check before committing? Almost nothing, which is the whole point.
Can Postgres be your vector database?
Often, yes, through pgvector. It’s an open-source Postgres extension that adds a vector type and exact and approximate nearest-neighbor search, with L2, inner-product and cosine distance among others, and two index types, IVFFlat and HNSW. It turns the database you already run into a capable vector store without adding a service to operate.
If you’ve heard that Postgres is slow at vectors, check the date on the claim. pgvector 0.5.0, released in August 2023, added HNSW, which pgvector’s own README says has better query performance than IVFFlat on the speed-recall tradeoff, at the cost of slower builds and more memory.
Getting there takes four steps, all of them plain SQL:
- Enable the extension that ships the vector type and the approximate nearest-neighbor indexes.
- Store embeddings next to the rows they describe, as a column on the existing table.
- Build an HNSW index for the distance you actually query with.
- Query with ordinary SQL: a
WHEREclause for filters,ORDER BYdistance, and aLIMIT.
-- Enable the extension that ships vector types and ANN indexes
CREATE EXTENSION IF NOT EXISTS vector;
-- Store embeddings next to the rows they describe
ALTER TABLE documents ADD COLUMN embedding vector(1536);
-- Build an HNSW index for the distance you actually query with
CREATE INDEX ON documents USING hnsw (embedding vector_cosine_ops);
-- Nearest-neighbor search, filtered by ordinary SQL, in one query
SELECT id, title
FROM documents
WHERE tenant_id = 42 -- an ordinary SQL filter
ORDER BY embedding <=> $1 -- cosine distance to the query embedding
LIMIT 5;The quiet advantage is in that last query. Your embeddings live in the same place as the rows they belong to, so a similarity search and an ordinary WHERE clause run together, in one round trip, inside one transaction. There’s no copy of the data in a second system and no tenant filter re-implemented in application code. One caveat: with an approximate index, pgvector applies the filter after the index scan, so a selective WHERE can return fewer than five rows. Since 0.8.0, SET hnsw.iterative_scan = strict_order; keeps the index scan going until enough rows match or a scan limit is reached.
How far does that carry you? A million 1,536-dimension vectors is about 6 GB of raw data, which fits in memory on a mid-sized instance, so low millions are within one Postgres server’s reach. Beyond that, the pgvectorscale extension adds a StreamingDiskANN index, inspired by Microsoft’s DiskANN research, and its README reports a benchmark on 50 million 768-dimension embeddings.
The practical limit is memory. pgvector’s README says HNSW indexes build significantly faster when the graph fits in maintenance_work_mem, and that queries will likely perform better when the index fits in memory. In AWS’s pgvector benchmarks, the HNSW index for five million 1,536-dimension embeddings was 38 GB, and on a 16 GB instance it managed 78 queries per second at a 1,356 ms p99. That appetite grows with both vector count and dimensions. The arithmetic for a common embedding size:
10,000,000 vectors x 1,536 dimensions x 4 bytes (float32)
= 61,440,000,000 bytes
= about 61.4 GB (57.2 GiB) of raw vector data, before the HNSW graph sits on topAdd the graph, the rest of your tables and Postgres’s own memory, and at that scale you’re choosing an instance for its RAM. There’s a dimension ceiling too: the standard vector type can index up to 2,000 dimensions, so indexing a 3,072-dimension model such as OpenAI’s text-embedding-3-large means using halfvec (indexable up to 4,000 dimensions) or requesting fewer dimensions from the API.
What does a dedicated vector database actually buy you?
At genuine scale, it buys tuned approximate nearest-neighbor performance, strong filtered search, and scaling that someone else operates. Each of the well-known options leans toward a different strength, and those advantages are real. The catch is the word “genuine”: most of them show up well past the scale where a typical product launches.
| System | What it leans into |
|---|---|
| Qdrant | Filters applied during the graph search, and self-hosting |
| Pinecone | A managed, serverless service |
| Weaviate | Built-in hybrid search, fusing vector and BM25F keyword results |
| Milvus | Distributed deployments designed for billion-scale workloads |
Each of these wins a specific fight:
- Sustained high query volume against a tight p99 target. A purpose-built engine tuned for exactly that can beat a general database trying to do everything.
- Search that’s mostly filtered (this user, this workspace, this language) at large scale. Qdrant extends its HNSW graph with edges based on indexed payload values, so filters apply during the search rather than after it.
- Never thinking about the box it runs on. Pinecone’s docs say its serverless indexes scale automatically.
These advantages matter most at large vector counts, at high and sustained QPS, or with filtering needs your primary database can’t serve efficiently.
Is vector search the slow part of a RAG request?
Usually not. In a retrieval-augmented generation request, an indexed nearest-neighbor query served from memory is one database lookup, while the model has to generate its answer token by token, and OpenAI’s latency guide calls token generation almost always the highest-latency step. The datastore is rarely the bottleneck people assume it is.
This is the part that reframes the whole decision. If the vector query takes five milliseconds and the round trips to the embedding model and the LLM take several hundred, then shaving a millisecond off retrieval by switching databases is invisible to the user:
One RAG request, illustrative
vector search (HNSW, moderate scale) ~5 ms
embedding call + LLM call several hundred ms
1 ms saved by switching vector stores invisible to the userYou’d be funding a migration and a permanent second system to optimize the fastest step in the pipeline. So what exactly are you speeding up? The gap between a model call and a database query is large enough to deserve its own treatment, which it gets in the real cost of an LLM call vs a SQL query.
Retrieval does become the bottleneck eventually, but mainly at high QPS or across a huge corpus, which loops right back to the same scale threshold. And if the problem is the quality of what retrieval returns rather than its speed, that’s a different conversation, covered in why your RAG system is actually a search problem.
What does a separate vector store really cost?
A synchronization problem you didn’t have before. The source rows live in your primary database and their embeddings live somewhere else, so every insert, update and delete now has to land in two places and stay consistent. That pipeline is invisible on the architecture slide and very visible at 2 am.
The failure modes here are dull and expensive. A backfill job half-finishes and the vector store drifts out of sync with the rows it indexes. A document gets deleted from Postgres but lingers in the vector database, so search keeps returning a hit that no longer exists. None of it is exotic. It’s the ordinary tax of keeping two systems agreeing about the same data, and someone has to own that tax. Who owns the pipeline when it drifts?
You also lose the easy join. With embeddings in Postgres, “find similar documents this user is allowed to see” is one query. Split across two systems, it becomes fetch from one and filter in the other, or replicate your access rules into a place they were never meant to live.
| Concern | Embeddings in Postgres | Separate vector store |
|---|---|---|
| Inserts, updates, deletes | One write, one transaction | Every change has to land in two places |
| Deleted documents | Gone from search with the row | Can linger and keep returning dead hits |
| Permission-filtered search | One query | Fetch, then filter elsewhere, or copy access rules |
| Access rules | Enforced where the data already lives | Replicated into a place they were never meant to live |
| Incidents | One system to debug | A second failure mode and on-call surface |
Add it all up and the true price of the dedicated store is a lot more than its monthly bill.
How do you decide whether you need a vector database?
Skip the benchmark for a minute. The decision is mostly four questions, and you can answer them before writing any code: how many vectors you’ll really have, what latency and throughput you need, whether the embeddings must live with the rest of your data, and whether that data is already in Postgres.
- How many vectors will you really have in twelve months? Not the pitch-deck number, the honest one. Under a few million and you’re comfortably in pgvector territory. Tens of millions and pgvectorscale is still in play. Hundreds of millions or billions is where a dedicated system starts to be the reasonable default.
- What’s your actual latency and throughput target? A handful of queries per second with a relaxed latency budget is easy for Postgres. Sustained high QPS against a tight p99 is where purpose-built engines pull ahead. Write the number down before you shop, not after.
- Do the embeddings need to live with the rest of your data? If your searches are filtered by tenant, permission, status or date, that’s a join, and keeping it in one database is a real advantage. If the vectors are an island with no relational neighbors, a separate store costs you less.
- Is the data already in Postgres? If yes, the burden of proof sits with the new system. You’re not adding vector search to your stack. You’re deciding whether to add a second database, and that should have to justify itself.
The first question on its own maps out like this:
| Honest 12-month vector count | Reasonable default |
|---|---|
| Under a few million | pgvector with HNSW |
| Tens of millions | pgvector, with pgvectorscale in play |
| Hundreds of millions or billions | A dedicated vector database |
If three of the four answers point at the database you already run, that’s your answer, and you’ve saved yourself a system. If three point the other way, you have a real reason rather than a reflex, and you can choose between Pinecone, Qdrant, Weaviate and the rest on their merits.
What should most teams do instead?
Start with the database you already run. Turn on pgvector, put the embeddings next to the rows they describe, index them with HNSW, and ship. You get vector search, transactional consistency, your existing backups and access controls, and one system to operate instead of two. Measured load will tell you when that stops being enough.
When it does, you’ll know, and you’ll know exactly which dedicated store solves the specific limit you hit. That’s a far better position to shop from than a tutorial’s step one.
The expensive mistake runs the other way. A team stands up a dedicated vector database for a few hundred thousand embeddings, inherits a sync pipeline and a second on-call surface, and spends the next year maintaining infrastructure sized for a scale they may never reach. The dedicated store wasn’t wrong as a technology. It was just early, and early is its own kind of cost.
So before the vector database goes on the diagram, ask the cheap question first. If your numbers look like the ones above, you already own a perfectly good answer. Most teams don’t need a vector database. They need to check whether they do. For more on the Postgres side, see the Databases articles; for retrieval and model work, the AI section.
Key takeaways
- Plenty of teams reaching for a vector database don't have a vector problem yet. A few hundred thousand 1,536-dimension embeddings is a few gigabytes of raw vectors at most.
- pgvector turns the Postgres you already run into a capable vector store. Its HNSW index, added in 0.5.0, beats IVFFlat on the speed-recall tradeoff, so check the date on any 'Postgres is slow at vectors' claim.
- Vector search is rarely the slow part of a RAG request. Generating tokens is almost always the slowest step of an LLM call, so the model, not the index, usually sets the latency budget.
- A separate vector store adds a synchronization pipeline and loses the easy join with your relational data. That's the easiest cost to underprice.
- The real signal to move is a working set that no longer fits in RAM on a box you're willing to pay for, or sustained high QPS against a tight p99.

Questions people ask
Can Postgres replace a vector database?
For many workloads, yes, through the pgvector extension. It adds a vector type, exact and approximate nearest-neighbor search with L2, inner product, cosine and other distances, and HNSW and IVFFlat indexes. Low millions of 1,536-dimension vectors fit in memory on one suitably sized instance, and the pgvectorscale extension adds a DiskANN-inspired index benchmarked on 50 million vectors.
When do you actually need a dedicated vector database?
When your honest twelve-month projection reaches hundreds of millions or billions of vectors, when you serve sustained high query volume against a tight p99 target, or when your working set no longer fits in RAM on a box you're willing to pay for. Below that, a dedicated store is usually early rather than wrong.
Is pgvector fast enough for production RAG?
For many workloads, yes, provided the HNSW index fits in memory. When it doesn't, latency balloons: AWS measured a 1,356 ms p99 with a 38 GB index on a 16 GB instance. In a typical RAG request, generating the model's answer takes far longer than an in-memory index lookup, so retrieval is rarely the bottleneck people assume.
How much memory does pgvector need for HNSW?
HNSW performs best when its index fits in memory, and that index grows with both vector count and dimensions. Ten million 1,536-dimension float32 vectors are about 61 GB of raw data before the index graph sits on top, so at that scale you're choosing an instance for its RAM. That ceiling is the signal to plan around.
What is the hidden cost of a separate vector store?
Synchronization. Source rows live in your primary database and embeddings live elsewhere, so every insert, update and delete must land in both and stay consistent. Half-finished backfills drift, deleted documents linger in search results, and permission-filtered searches need two systems instead of one join.
Get the next article by email
One email when a new deep-dive is out: databases, cloud and AI, with the code. Unsubscribe in one click.
Email signups open soon. Until then, new articles are announced on Instagram.
