Ivfflat
IVFFlat is an approximate nearest-neighbor vector index that partitions vectors into centroid-based inverted lists and compares vectors within selected lists.
Just Use Postgres!
An IVFFlat index is an approximate nearest-neighbor index that assigns vectors to inverted lists organized around cluster centroids.
- How it is used
- Optimizes vector similarity search for a Postgres movie recommendation service using approximate nearest-neighbor retrieval.
- How deep it goes
- Explains clustering, centroid assignment, query flow, indexing, execution plans, and probes without deep mathematical treatment.
- Examples
- Uses movie embeddings, the phrase “May the force be with you,” CREATE INDEX, EXPLAIN plans, and probe-adjusted query results.
- What you can do after
- Operate/configure pgvector IVFFlat indexes, run similarity searches, inspect plans, and adjust probes for recall.
Designing AI Systems
IVFFlat is an approximate vector index that partitions vectors into clusters and searches selected clusters to accelerate similarity queries.
- How it is used
- Accelerates similarity search over growing embedding collections in a PostgreSQL-backed data service.
- How deep it goes
- Explains clustering, approximate recall, list sizing, and data requirements, but does not detail query-planner internals.
- Examples
- Uses a pgvector PostgreSQL schema with vector_cosine_ops and lists = 100 as the concrete implementation example.
- What you can do after
- Operate/configure a pgvector IVFFlat index and choose an initial cluster count for a growing embedding collection.
Also covered in
What to know first
- similarity searchSimilarity search is a retrieval technique that finds or ranks items by their similarity to a query, often by comparing feature or vector representations under a similarity or distance measure.
- recallRecall is the proportion of all relevant or actual positive items that a system successfully retrieves or correctly identifies.
- schemaA data schema is a formal specification of the structure, fields, types, relationships, and constraints of data.
Related concepts
- approximate nearest neighbor searchimplements · Approximate nearest neighbor search efficiently finds items close to a query under a distance or similarity measure without guaranteeing the exact nearest items.
- index typekind of · An index type is a database indexing method defined by the structure and access strategy it uses to support data retrieval.
- search indexkind of · A search index is a data structure that organizes searchable representations of content to support efficient retrieval in response to queries.
- pgvectorused by · pgvector is a PostgreSQL extension that adds vector data types, similarity operations, and indexes for storing and searching vector data.
- HNSWalternative to · HNSW is a graph-based approximate nearest-neighbor indexing and search method that organizes data points in a hierarchy of navigable proximity graphs.
Questions about ivfflat
What is ivfflat?
IVFFlat is an approximate nearest-neighbor vector index that partitions vectors into centroid-based inverted lists and compares vectors within selected lists.
Which Manning books explain ivfflat?
Just Use Postgres! and Designing AI Systems.
What should I know before learning ivfflat?
Manning books that teach ivfflat usually introduce similarity search, recall and schema first.
What is the difference between ivfflat and HNSW?
IVFFlat is an approximate nearest-neighbor vector index that partitions vectors into centroid-based inverted lists and compares vectors within selected lists. HNSW is a graph-based approximate nearest-neighbor indexing and search method that organizes data points in a hierarchy of navigable proximity graphs.
What is ivfflat a kind of?
Ivfflat is a kind of index type. An index type is a database indexing method defined by the structure and access strategy it uses to support data retrieval.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.

