[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)

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

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 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

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

According to benchmark data provided by the project, Pg_vectorsearch surpasses pgvector's IVFFlat and HNSW in query throughput.

Expired50%
Oct 14

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

Unverified50%
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%

5 more timeline events

All Facts (14)

Verified

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

80%
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.

70%
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%
Unverified

HNSW 和 IVF 是两类主流的近似最近邻索引算法,HNSW 查询速度快、召回率高但内存占用较大

50%

Source Articles