Skip to main content

Menu

Webinar

Built for the Agentic Era: Introducing MariaDB Enterprise Platform 2027

Register now

MariaDB 12.3: Faster Vector Search with Matryoshka Optimization

By Egor Ustinov

9 min read
Share

Key takeaways

  • Up to 30% faster AI search performance: MariaDB 12.3 automatically speeds up high-accuracy vector queries by using a quick initial filter to eliminate poor matches before running full calculations.
  • Zero setup or developer tuning: The optimization works out of the box on existing data, requiring no schema changes, query updates, or manual index configuration.
  • Lower infrastructure and operational costs: Cutting redundant background math boosts your throughput and lets you keep vector search inside your primary database instead of managing a separate engine.

A technique that uses the most informative low-dimensional prefix of an embedding to cheaply discard far-away candidates, then computes the full distance only for the close ones — cutting compute while preserving recall.

Because production systems run at high recall (typically 0.94 and above). Throughput measured at lower recall does not reflect real cost or accuracy.

No. The optimization requires no schema, index, or query changes. Existing MariaDB Vector workloads benefit on upgrade to 12.3.

Yes. These models — along with many Sentence Transformers — produce embeddings with usable prefix structure that the optimization can exploit.

On the dbpedia-openai-1000k benchmark, up to 30% higher QPS at equivalent recall, with the largest gains at the high-recall end. Results vary by dataset and embedding model.

MariaDB tests whether the prefix predicts full-vector distance on your data. If it does not, the engine uses standard full-distance computation — no penalty, no configuration.

For many workloads it removes the need to run one alongside MariaDB, consolidating transactional, JSON, analytical, and vector workloads in a single engine.