Mid-level Track Roadmap

AI vector search: pgvector

This course covers approximate nearest neighbor search in Postgres with pgvector. It starts from a sequential scan, reads EXPLAIN ANALYZE output, and explains recall as the cost of approximate indexes. It then covers distance operators and matching operator classes, IVFFlat lists and probes, and HNSW with m, ef_construction and ef_search. Later lessons handle filtered queries with iterative scans, partial indexes and partitioning, then quantization with halfvec and binary vectors plus rescoring. The last lesson measures recall against exact search and tracks it in CI.

What you'll learn

  • ✓Reading EXPLAIN ANALYZE and calculating recall@k for vector queries
  • ✓Pairing distance operators with the matching operator class
  • ✓Sizing and tuning IVFFlat lists and probes and HNSW m, ef_construction and ef_search
  • ✓Handling filtered queries with iterative scans, partial indexes and partitioning
  • ✓Reducing storage with halfvec, binary quantization and rescoring
  • ✓Tracking recall against exact search in CI
Free preview · Lesson 1 5 min read

From sequential scan to vector index

A nearest-neighbor query with no index is honest work. Postgres computes the distance from your query vector to every row, sorts, and returns the top ten. It is exact, and at ten thousand rows it takes about the time you would spend blinking.

Read the full lesson free →

Curriculum

7 lessons
Type to start searching...