📦
IVF_FLAT Index
Groups vectors into clusters · searches only the nearest cluster
IVF_FLAT groups vectors into clusters. The query finds the nearest cluster center, then searches only inside, skipping all other vectors.
Flow:
📥 Query
→
📦 Nearest Cluster Center
→
🔍 Search Inside
→
🏆 Top Match
🎯
Query Vector
➕
Insert New Vector
📦
Cluster 1
high-y ✓ Selected
Center (auto)
x
y
z
Sim to query: —
Members
📦
Cluster 2
high-x ✓ Selected
Center (auto)
x
y
z
Sim to query: —
Members
—
Clusters
2
centers compared to find the nearest one
Vectors
3
vectors searched inside the chosen cluster
Total
5
vs 6 if FLAT scanned everything
📊
Results
Live💡 Key Idea
Narrows search to one cluster. Skips most comparisons for a fast approximate result.
✅ Best For
Medium-large datasets needing speed with reasonable accuracy.
🎓
Tips
3 tips
Clusters narrow the search. IVF_FLAT only compares vectors inside the nearest cluster(s) instead of the whole dataset.
Fewer clusters searched = faster but riskier. If the true nearest neighbor sits in a cluster that wasn't searched, it can be missed.
This is a common first step toward faster search, it keeps full-precision vectors, unlike IVF_SQ8 or IVF_PQ which also compress them.
💡
Key Takeaway
IVF_FLAT speeds up search by only checking the nearest cluster(s) instead of every stored vector, faster, with a small chance of missing the true best match.