Two parameters control ivfplus at build and query time: lists, set once when the index is created, and probes, tunable per session. If you leave them out, Vector Plus chooses both automatically. As they grow, both affect recall, latency, index size, and build cost.
Choosing lists
lists is set once, at index build time. Leave it out and it's sized automatically; an explicit value must be 1–32768.
Automatic lists resolves at build time to:
ceil(sqrt(rows))below 450,000 rows.ceil(4 × rows / 1000)from 450,000 rows, where the index is two-level.
The result is clamped to 100–32768. For example: 100 up to 10,000 rows, about 670 just below 450,000, 1,800 at 450,000, 4,000 at 1 million, and the 32,768 maximum from about 8.2 million rows. Two-level navigation scores compressed centroid codes, so many small lists are affordable.
Check the value the build chose in the NOTICE output:
NOTICE: ivfplus: lists resolved automatically to 4000 (estimated 1000000 rows)
The row count is estimated from 1024 randomly sampled heap blocks rather than from reltuples, which is absent on a never-analyzed table and stale after a bulk load. The estimate is noisy only when the indexable rows sit in a small fraction of the heap, for example after a large DELETE without VACUUM, or when most rows have a NULL vector. Set lists explicitly for such a table. ivfplus_metapage_info(index).leaf_lists shows what an existing index got.
Automatic lists sizes from the rows present at build time. An index created on an empty table gets the floor of 100 lists and keeps it until REINDEX, which re-resolves against the current row count. An explicit lists isn't derived from table size at all. If the table will grow far beyond its size at build time, set lists explicitly for the expected row count:
| Rows | Suggested lists |
|---|---|
| < 10k | 100 |
| 10k – 450k | sqrt(rows) (what automatic picks) |
| ≥ 450k | 4 × rows / 1000 (what automatic picks; two-level), 4000 at 1M rows |
As lists grows:
- Build memory rises quadratically — k-means samples
max(50 × lists, 10000)rows, and Elkan's bound matrix isO(lists²)floats. lists >= 1800switches the index to the two-level hierarchy (see Architecture). Automaticlistscrosses that line at 450,000 rows.- The two-level build is single-threaded, so crossing that line forfeits parallelism. Budget for a longer build.
If sampled rows come out fewer than lists, the build emits NOTICE: ivfplus index created with little data. This means the clustering had almost nothing to work with, and learned centroids might be useless, resulting in low recall after future inserts. This is preventable: leave lists automatic, or choose it for your actual row count, and build the index after loading the data.
Choosing probes
probes isn't used at index build — it's a session parameter that determines how many leaf lists a query scans. Recall and latency both rise with it; values above the index's actual lists are clamped to min(probes, lists).
Leave ivfplus.probes unset and each scan chooses it from the index's own lists: clamp(ceil(0.83 × lists^0.58), 1, lists). SHOW ivfplus.probes reads auto, and RESET ivfplus.probes returns to it. Automatic probes targets about 0.95 recall@10 on hard datasets and exceeds that on typical embeddings. It doesn't take LIMIT into account.
To set it explicitly for higher recall or a larger LIMIT, use SET, and measure the result (see Measuring recall):
SET ivfplus.probes = 32; -- session SET LOCAL ivfplus.probes = 64; -- one transaction RESET ivfplus.probes; -- back to automatic
Index size and build cost
The following table breaks down where an index's storage goes, in bytes per row, by region and by which kind of build produces it:
| Region | Bytes per row | Present when |
|---|---|---|
| Frozen packed block | 1028/32 + dim/8 ≈ 32 + dim/8 | quantized opclass, packing window met |
| Spill code | Same as the frozen packed block, for rows that spill | packing window met, lists > 1 |
| f16 rerank copy | 6 + 2×dim, plus a 4-byte line pointer | stock builds, or store_vectors = on |
| Append tuple | 40 + 8×ceil(dim/64), plus a 4-byte line pointer | rows inserted after the build |
| Centroids | lists × dim × 4 (× 2 for halfvec) total, not per row | always |
For example, 1M rows at 768 dimensions with lists = 1000: packed blocks are about 128 B/row (~122 MiB total), the f16 copy is about 1546 B/row (~1.44 GiB total), and centroids are about 2.9 MiB. The f16 copy is roughly 92% of the index size — a rerank-policy build (see Index-rerank-policy builds) drops it by default, taking that same index from ~1.6 GiB to ~125 MiB.
k-means runs over max(50 × lists, 10000) sampled rows. maintenance_work_mem must hold the samples, the centers, and an O(lists²) Elkan half-distance matrix, or the build fails with ERROR: memory required is 412 MB, maintenance_work_mem is 64 MB. Parallel build uses up to max_parallel_maintenance_workers, but only for lists < 1800.