[KongchangAI]
ConceptInverted File Flat

IVFFlat

An approximate nearest neighbor indexing method based on k-means clustering. It groups vectors into a number of clusters and scans only the nearest clusters at query time. It has low memory overhead and fast build times, but recall is generally lower than that of HNSW.

Core Facts

Timeline (last 90 days)

Nov 26

Common indexes for pgvector include IVFFlat and HNSW; the former builds quickly but its recall is affected by parameters, while the latter has better query performance but higher memory usage.

Unverified50%
Nov 7

pgvector supports two types of vector indexes, HNSW and IVFFlat, and index construction and queries are constrained by PostgreSQL's page management, concurrency control and memory model.

Unverified50%
Oct 17

IVFFlat clusters the vector space into multiple Voronoi cells; on insertion it only computes the owning cluster and appends, with no global graph restructuring, so write throughput is higher, but recall is usually lower than HNSW.

Unverified50%
Oct 17

The lists parameter of IVFFlat is generally recommended to be the square root of the row count, but write-intensive scenarios can use a smaller lists (e.g., 100) to reduce insertion overhead.

Unverified50%
Oct 17

Creating both an IVFFlat index (for writes) and an HNSW index (for reads) to separate reads and writes can solve the write-write blocking problem, raising insertion throughput from 50/s to 180/s.

Unverified50%
Oct 16

IVFFlat requires that the table already contain representative data when the index is built, otherwise the cluster centers cannot reflect the true distribution, and after new data is written the list distribution gradually becomes imbalanced and recall may drop, requiring periodic index rebuilds.

Unverified50%
Oct 16

HNSW should be chosen for scenarios with frequent writes, continuously growing data, and sensitivity to recall; IVFFlat should be chosen for scenarios where data is relatively static, memory is tight, and periodic rebuilds are acceptable.

Unverified50%
Oct 16

IVFFlat first uses k-means to cluster vectors into several lists, and at query time only scans the several lists closest to the query vector, with the probes parameter controlling the number of lists scanned.

Unverified50%
Oct 14

The official announcement of pg_vectorsearch did not give the dimensionality of the benchmark dataset, the throughput (QPS), or a direct IVFFlat comparison, and multi-client throughput testing is listed as a to-be-completed item.

Expired50%
Oct 14

IVFFlat uses two parameters, lists (the number of cluster buckets) and probes (the number of buckets actually scanned during a query); lists is often taken as rows/1000 (when the number of rows does not exceed one million) or sqrt(rows), and probes is usually tuned starting from sqrt(lists).

Unverified50%

6 more timeline events

All Facts (16)

Verified

pgvector is an open-source extension for PostgreSQL that natively adds vector data types and similarity search capabilities to the relational database, supporting both exact nearest-neighbor and approximate nearest-neighbor (HNSW, IVFFlat index) retrieval modes.

90%
Verified

向量数据库的核心操作是近似最近邻搜索(ANN),通过HNSW、IVF等索引算法将相似度计算加速到毫秒级响应

80%
Verified

HNSW and IVF are two mainstream approximate nearest neighbor indexing algorithms; HNSW offers fast query speeds and high recall but requires relatively large memory.

65%
Unverified

Common indexes for pgvector include IVFFlat and HNSW; the former builds quickly but its recall is affected by parameters, while the latter has better query performance but higher memory usage.

50%
Unverified

pgvector supports two types of vector indexes, HNSW and IVFFlat, and index construction and queries are constrained by PostgreSQL's page management, concurrency control and memory model.

50%
Unverified

The lists parameter of IVFFlat is generally recommended to be the square root of the row count, but write-intensive scenarios can use a smaller lists (e.g., 100) to reduce insertion overhead.

50%
Unverified

IVFFlat clusters the vector space into multiple Voronoi cells; on insertion it only computes the owning cluster and appends, with no global graph restructuring, so write throughput is higher, but recall is usually lower than HNSW.

50%
Unverified

Creating both an IVFFlat index (for writes) and an HNSW index (for reads) to separate reads and writes can solve the write-write blocking problem, raising insertion throughput from 50/s to 180/s.

50%
Unverified

IVFFlat requires that the table already contain representative data when the index is built, otherwise the cluster centers cannot reflect the true distribution, and after new data is written the list distribution gradually becomes imbalanced and recall may drop, requiring periodic index rebuilds.

50%
Unverified

HNSW should be chosen for scenarios with frequent writes, continuously growing data, and sensitivity to recall; IVFFlat should be chosen for scenarios where data is relatively static, memory is tight, and periodic rebuilds are acceptable.

50%
Unverified

IVFFlat first uses k-means to cluster vectors into several lists, and at query time only scans the several lists closest to the query vector, with the probes parameter controlling the number of lists scanned.

50%
Unverified

pgvector provides two index types, IVFFlat and HNSW, respectively aimed at different recall and speed trade-off scenarios.

50%
Unverified

IVFFlat uses two parameters, lists (the number of cluster buckets) and probes (the number of buckets actually scanned during a query); lists is often taken as rows/1000 (when the number of rows does not exceed one million) or sqrt(rows), and probes is usually tuned starting from sqrt(lists).

50%
Unverified

When the data distribution is skewed or the number of clusters is set improperly, IVFFlat will face the dilemma of recall collapsing because too few buckets are scanned, or speed degrading because too many buckets are scanned.

50%
Unverified

pgvector supports two mainstream types of indexes, HNSW and IVFFlat; HNSW has high recall and low latency but is slow to build and uses a lot of memory; IVFFlat has low memory overhead and builds quickly but usually has lower recall.

50%
Unverified

At very large scale datasets, pgvector's performance based on IVFFlat or HNSW indexes is often constrained by single-machine memory and CPU resources, making horizontal scaling difficult.

50%

Source Articles