SproutStack logoSproutStack
···

🌱 Tool Showdowns · Head-to-head comparisons · cozy lesson

pgvector vs Dedicated Vector DBs

10 min · 1 min read · no scary math, promise

🤖
You’ve got this. Read a little, play a little — I’ll wait. No rush.

The one-line verdict

  • Data already in Postgres? pgvector — vectors as a column, similarity in SQL, one backup to manage.
  • Outgrowing it? Qdrant / Pinecone / Chroma (see our vector-DB showdown) — purpose-built scale and filtering.

Official homes: pgvector · Supabase AI guide · Qdrant.

pgvector in 5 lines

CREATE EXTENSION IF NOT EXISTS vector;
CREATE TABLE docs (
  id bigserial PRIMARY KEY,
  content text,
  embedding vector(1536)
);
CREATE INDEX ON docs USING hnsw (embedding vector_cosine_ops);
SELECT content FROM docs ORDER BY embedding <=> '[0.1, 0.2, ...]' LIMIT 4;

When dedicated wins

  • Billions of vectors or strict p99 latency budgets.
  • Metadata filtering at a scale where a single Postgres box sweats.
  • You want managed uptime someone else wakes up for.

Until then, pgvector plus the chunking and eval discipline from our RAG chapters beats a fancier database with sloppy retrieval.

Check your understanding

Correct answers earn XP (once each).

1. Your app data already lives in Postgres?

2. Move to dedicated when…

My notes (saved in this browser)

Select text above → Save selection, or write your own. AlgoMaster-style notebook, local-first for MVP.

No notes yet. Your highlights will live here.

Finished reading? Seal it with a tick ✅

The checkbox in the explorer turns green too — same progress.