At what scale does 'just put it in Postgres with pgvector' stop being the right answer?
pgvector wins when Postgres is already running, the corpus is under ~10M vectors, and transactional consistency with relational data matters. It stretches to ~50M with HNSW on big hardware.
Imagine you already own a big general purpose toolbox (Postgres). pgvector is a vector-search drawer you can add to that toolbox. If you only need to search a small to medium collection of vectors, it is silly to buy a separate, specialized vector-search toolbox just for that; using the drawer you already have is simpler. But if your collection grows huge, the general purpose toolbox starts dragging the search drawer down, and a dedicated vector-search toolbox becomes worth its own keep.
Detailed answer & concept explanation~3 min readEverything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example.
Everything important, quickly.
3 min: pgvector's operational win + the three sweet-spot conditions + the 10-50M crossover number + why each distractor is wrong.
| Corpus size | Verdict on pgvector |
|---|---|
| Under 1M | Almost always right; ANN is barely needed |
| 1M-10M | Sweet spot; pgvector with HNSW is the production answer if Postgres exists |
| 10M-50M | pgvector still viable on big hardware; the call depends on RAM headroom |
| 50M-100M | Mostly migrate to a dedicated vector DB unless you specifically tune Postgres for this |
| 100M+ | Dedicated vector DB; pgvectorscale is the last hold-out option |
Real products, models, and research that use this idea.
- Supabase ships pgvector in their managed Postgres and many production SaaS products run RAG against it.
- Neon (serverless Postgres) supports pgvector and markets it for B2B RAG use cases.
- AWS RDS for Postgres and Aurora ship pgvector for use cases where the corpus fits the sweet spot.
- pgvectorscale (Timescale) extends pgvector with disk-based HNSW for larger corpora while staying on Postgres.
- Notion's public engineering posts describe their Postgres + pgvector path for the early phases of their AI features.
What an interviewer would ask next. Try answering before peeking at the approach.
QWhat does pgvectorscale add that base pgvector cannot do?
QHow does pgvector handle transactional updates to embeddings?
Don't say thisRed flags and common mistakes that signal junior thinking. Click to expand.
Red flags and common mistakes that signal junior thinking. Click to expand.
Either dismissing pgvector as 'just a prototype' (it serves millions of vectors in production at many companies) or believing it can scale to billions on a single Postgres node (it cannot, regardless of how the HNSW math looks).
The night-before-the-interview bullets. Scan these on the way to the call.
Primary sources. Skim if you want the original framing.
Same topic, related formats. Practice these next.