ONE-PASS HNSW SEARCH FOR MARIADB VECTOR SEARCH
MariaDB's HNSW vector index searches the graph layer by layer, isolating each level's connections. This means denser lower-layer edges are invisible until a separate pass reaches them, and the purely flat alternative, which expands all layers unconditionally, wastes distance computations on unproductive regions, degrading performance. Solution: Implement VF-HNSW (Virtually Flattened HNSW), a new search mode for MariaDB's vector search engine. VF-HNSW searches all layers in a single pass with adaptive descent: for each candidate, it expands neighbors from the top layer downward, using sparse upper layers as cheap probes and stopping early when a layer fails to improve on the one above, avoiding expensive dense-layer expansion for candidates in unproductive regions. Deliverables: A vf_hnsw search mode in sql/vector_mhnsw.cc with adaptive descent, including correctness and regression tests. A benchmark report comparing hierarchical, flat, and VF-HNSW across ANN-Benchmarks datasets, with recommended defaults and tradeoff analysis. Per-query status variables expose upper-layer expansions attempted, layers skipped, and distance computations saved.
Project details
Technologies
Not listed in the archive