IndexIVFPQ
IndexIVFPQ is a data structure for scalable approximate nearest neighbor search that combines an inverted file (IVF) with Product Quantization (PQ). It is designed for high-dimensional vector collections and is commonly used in libraries such as FAISS. The index first partitions the vector space into a fixed number of coarse clusters (nlist) using a coarse quantizer. Each database vector is assigned to one coarse cell, and its residual vector (the difference between the vector and the cell centroid) is then compressed with PQ. The resulting PQ codes are stored in the corresponding inverted lists.
In operation, a query is first compared against the coarse centroids to identify the most relevant cells.
Key parameters include nlist (the number of coarse clusters), nprobe (the number of cells examined during search),