VECTOR SEARCH · PROBE · COMPARE · INSPECT
Vector ANN: inspect candidates and exact recall
Search actual index lists and compare returned neighbors with a full-scan baseline.
Exact candidate evidence
Inspect vectors, list membership and neighbor distances
Search a subset, then measure what was missed
This lab builds a small inverted-file index over seeded two-dimensional vectors. Training assigns each point to its closest learned center, forming a list of point identifiers. At query time, the index ranks the centers, opens only the requested nearest lists, evaluates their members and returns the closest candidates. The exact baseline scans every point independently. Recall is the number of returned identifiers also present in that exact top-k set, divided by the size of the exact result. The candidate set can omit a true nearest neighbor even when the selected center is close. This is actual restricted search, not an exact full scan relabeled approximate.
Choose the dataset and the index
Stored vectors sets the dataset size from zero to two hundred. Dataset seed reproduces coordinates; increasing the size with the same seed preserves the coordinate prefix but rebuilds the index. Add 20 vectors increases the size up to the cap. Clear vectors creates a valid empty dataset, and Restore defaults restores every setting. Index lists chooses the number of centers, capped by the number of stored points. Training uses deterministic farthest-point initialization and up to twenty-four Lloyd iterations; empty clusters retain their center. Those are stated teaching choices, not a reproduction of pgvector training internals. Every parameter edit rebuilds the scenario and pauses inspection at its beginning.
Control the query and the candidate budget
Query X and Query Y position the query from zero to one hundred. Use the labeled sliders with keyboard arrows or touch, or tap the plot to set both coordinates. Requested neighbors k limits result size, but a small candidate set may return fewer than k results. Lists probed chooses the nearest lists searched, capped by the number of centers that actually exist. Index lists changes the partition itself; Lists probed changes only which existing partitions are searched. Increasing probes for a fixed dataset, index and query cannot decrease this fixture’s exact top-k recall. Equal distances are ordered by point identifier.
Reproduce a missing-neighbor case
Restore defaults: eighty vectors, seed forty-two, eight lists, one probed list, k five and query coordinates fifty, fifty. Show final result returns five candidates but only three belong to the exact top five, giving sixty-percent recall. The missing exact neighbors have red rings, while returned points outside the exact top five are amber. Raise Lists probed to eight and inspect again: all eighty points become candidates and recall reaches one hundred percent. Change the query position while keeping one probe and see the result depend on the partition boundary. Clear vectors and query again: the result stays empty, and recall is explicitly undefined rather than a fabricated zero or perfect score.
Follow the candidate trace at your pace
Play reveals center selection, each opened list and each evaluated point over sixty inspection seconds. Pause holds the state; Next decision advances one event; Restart rewinds; Speed changes viewing pace; Inspect time scrubs the trace. Show final result jumps directly to the completed search. Colored cells indicate selected lists, dark center labels identify their partitions, and the query is a cross. Green result points match the exact baseline; amber results do not; red rings mark baseline neighbors not currently returned. The readable result and exact inspector repeat coordinates, distances, memberships and identifiers. Early recall describes the partial scan, not the final quality.
Separate this fixture from a database benchmark
The official pgvector documentation describes exact search as the default and HNSW or IVFFlat as optional approximate indexes. This browser fixture illustrates an inverted-file candidate budget with L2 distance; it does not implement HNSW, run PostgreSQL or predict a query plan. It has no high-dimensional embeddings, SQL filters, iterative index scans, concurrent writes or disk I/O. The work readout counts logical candidate-point and center comparisons, excluding index training and the exact teaching baseline. It is not elapsed runtime, a universal complexity bound or a guaranteed speedup. Searching all lists recovers exact results here but also performs center-selection work that a simple exact scan does not need.
Implementation reference: official pgvector indexing documentation.