Native vector search (HNSW) for MySQL, benchmarked head-to-head vs vsql_vector, pgvector & MariaDB · 2026-11-10 13:49 UTC
fair same-host · cross-engine · by version · glove 1.2M · neutral harness · x86 / cross-ISA
Bottom line: with the shipped optimizations (PR #278 + #280), MyVector's HNSW leads at matched recall on the same host and dominates at scale, benchmarked against VillageSQL's vsql_vector, pgvector, and MariaDB's native vector index on real ann-benchmarks datasets scored vs published ground truth. These are same-host, shared-box measurements with the method fully disclosed (equal cores, cache-above-index, sequential) — read a 2–3× lead as 'clearly ahead', not a precise ratio.
fashion-mnist-784, four engines, one Ampere A1 host, recall@10 vs published ground truth — controlled re-run 2026-11-10 (current main incl. #280; every engine pinned to the same cores with its working set cached above the index, run one-at-a-time). Up and to the right is better. Each line is an ef_search sweep. MyVector's curve sits above the others across the whole recall range (~2–3× the QPS at matched recall); MariaDB is 2nd and fast on this small set but cannot build the 1.2M glove index; pgvector and vsql track each other below.
Source: /fair/ same-host measured ef_search sweep (M=16, ef_construction=200). Log QPS axis.
| # | Finding | Evidence |
|---|---|---|
| 1 | Clear lead at scale. On glove-100 (1.18M, cosine) MyVector builds in ~46 min and serves the most QPS at matched recall; vsql's build is super-linear (~7 h) and MariaDB cannot build the index within 10 h (measured, excluded). | /glove/ |
| 2 | Leads the small same-host 4-way too (after #280). In the controlled re-run, MyVector serves the most QPS at every matched-recall point — ~2695 vs pgvector 1343 / vsql 1176 at recall 0.975, ~2143 vs MariaDB 965 at recall 0.998. (The earlier version of this page showed it trailing — that was pre-#280 and measured under host load; see the /fair/ caveats.) | /fair/ |
| 3 | The comparison reproduces in a neutral harness — VillageSQL's own vector-dev-bench, not just MyVector's — so it isn't a measurement artifact. | /village/ |
| 4 | The speedups are hardware-general. The vectorized distance kernels reproduce on AMD (9.4×), Intel (4.2×) and ARM/NEON (3.8×) silicon. | /x86/ |
| Change | What | Measured effect | Status |
|---|---|---|---|
| PR #278 | Vectorized the scalar HNSW distance kernels (L2/IP/cosine) + keepPrunedConnections in graph construction | Build 1.8–2.6× faster; recall-per-ef lifted onto pgvector's curve | Merged to main |
| PR #280 | Removed a std::regex pass over the query-vector literal in the ANN rewrite | +48% to +80% QPS at low ef_search, identical recall (same-host A/B) | Merged to main |
| RFC #281 | Design to remove the remaining JSON_TABLE round-trip (~0.28 ms/query) | Est. further +20–40% at low ef (to be confirmed) | Design review |
vsql_vector, pgvector (Postgres 17), MariaDB 12.3 native vector index.fashion-mnist-784 (60k×784, L2), nytimes-256 (290k×256, cosine), glove-100 (1.18M×100, cosine) — ann-benchmarks HDF5, recall@10 vs the datasets' published exact neighbors.