Same topic, related formats. Practice these next.
Same topic, related formats. Practice these next.
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.
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.
What an interviewer would ask next. Try answering before peeking at the approach.
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.