Skip to main content
Intermediatecomparison Verified ~9 min

What is a vector database? How do HNSW and IVFFlat indexes differ?

Source: pgvector README (github.com/pgvector/pgvector)

Quick answerFree

It stores embeddings and finds the nearest ones to a query vector by a distance such as cosine, L2 or inner product. Exact search over millions of vectors is slow, so indexes approximate it.

Detailed answer· ~350 words

Interview Prep

Unlock the full answer with Interview Prep

Get a ~350-word model answer, 5 key points, a visual explainer, 5 common mistakes and 5 follow-ups, plus 24 more Generative AI questions.

Also in Pro (₹499 / 90 days).

Key points· 5 points

Interview Prep
Unlock with Interview Prep

Visual explainer· animated, step by step

Interview Prep
Unlock with Interview Prep

Common mistakes· 5

Interview Prep
Locked

Best practices· 5

Interview Prep
Locked

Likely follow-ups· 5 questions

Interview Prep
Unlock with Interview Prep

+ 24 more Generative AI questions in Interview Prep, each with the full answer.

Discussion