A vector search over 50 million chunks is too slow with exact (FLAT) search. What is the usual optimization?
- Exam domain
- Knowledge Integration and Data Handling10% of the exam
- Difficulty
- Medium
- In this mock
- 7 questions on this domainPractise this domain
Why the exam asks this
Knowledge Integration and Data Handling.
Objective in the exam guide: Configure and optimize vector databases for fast retrieval.
Index choice decides speed at scale.
Why B is the answer
Use an approximate nearest neighbor index such as HNSW or IVF, and tune it for the needed recall
ANN indexes trade a little recall for much faster search; parameters tune the balance.
How it works
FLAT search compares the query with every vector.
ANN indexes such as HNSW and IVF search a subset.
They are much faster with slightly lower recall.
Clues in the question
The words that point to the answer, and what each one tells you.
- Exact search too slow at scale
- Approximate index.
In detail
- FLAT search gives 100% recall but scans everything.
- Measure recall against exact search on a sample.
Side by side with look-alikes
| Index | Speed | Recall |
|---|---|---|
| FLAT | Slow at scale | 100% |
| HNSW | Fast | High, tunable |
| IVF | Fast | Tunable |
Every option, checked
Knowing why each wrong option fails is how you rule it out on exam day.
A. Run exact search twice to average resultsWrong
Repeating exact search doubles the cost.
B. Use an approximate nearest neighbor index such as HNSW or IVF, and tune it for the needed recallRight
ANN indexes trade a little recall for much faster search; parameters tune the balance.
C. Switch to a larger embedding dimensionWrongMost tempting
Larger vectors slow search further.
Why it tempts: It may improve quality. But it makes search slower.
D. Remove all metadata from chunksWrong
Metadata is needed for filtering.
In practice
- Benchmark recall at the latency budget, not latency alone.