pgvector index benchmark

pgvector index benchmark An architecture diagram generated by Archify. Wikipedia · 200 · 5k · 50k articles · Architecture component Wikipedia 200 · 5k · 50k articles fetch_wikipedia · wiki_docs.jsonl · Architecture component · Python fetch_wikipedia wiki_docs.jsonl chunk_docs · 180 words · 40 overlap · Architecture component chunk_docs 180 words · 40 overlap embed_chunks · memmap .npy · mps/cuda · Architecture component embed_chunks memmap .npy · mps/cuda all-MiniLM-L6-v2 · 384-dim · L2-normalized · Architecture component all-MiniLM-L6-v2 384-dim · L2-normalized Postgres 17 · pgvector · pgvectorscale · Docker · port 5433 · PostgreSQL Postgres 17 pgvector · pgvectorscale load_postgres · COPY → unindexed table · Architecture component load_postgres COPY → unindexed table visualize · light + dark PNG charts · Architecture component visualize light + dark PNG charts results/ · benchmark json · csv · Architecture component results/ benchmark json · csv benchmark · ivfflat · hnsw · diskann · Architecture component benchmark ivfflat · hnsw · diskann query_vectors.npy · seeded holdout · Architecture component query_vectors.npy seeded holdout HF stream docs chunks encode embeddings COPY hold out N queries build · query · drop write render Docker · port 5433 Legend Frontend Backend Database Message bus External

Per index, per tier

  • • Build on a fresh table, time it, size it
  • • Query p50 / p95 / p99 + serial QPS
  • • Drop before the next index

Honest recall

  • • exact seq-scan is the ground truth
  • • recall@10 at one QUERY_TUNING point
  • • Compare only at matched recall

Memory squeeze

  • • mem_limit + maintenance_work_mem sweeps
  • • HNSW falls to a two-pass disk build
  • • DiskANN index ~3.7x smaller