MariaDB Vector: How it works. Part IV

This is the last post in the “MariaDB Vector: How it works” series. The first three were about storage, in-memory representation, HNSW modifications. Everything that was done in MariaDB 11.8. This post talks about new feature in MariaDB 12.3: optimized distance calculation.

As I mentioned earlier, distance calculation is the most time consuming part of the vector search, taking 80–90% of the total search time. Also it is linear on the number of dimension — computing the distance between vectors of 1536 dimensions takes twice as long compared to vectors of 768 dimensions.

MariaDB Vector: How it works. Part III

In the previous parts of this series we’ve seen how MariaDB stores vector indexes in a table and how to implement HNSW for a good performance. But MariaDB is not implementing HNSW, it calls its vector search algorithm mHNWS, a modified HNSW. Let’s see how exactly it was modified.

Not so greedy!

HWNS, like many, if not most, graph based vector search algorithms is greedy. Think of it this way, when it needs to find just one nearest vector (ef=1), it will walk the graph always choosing the node that will take it the closest to the target at this particular step.

MariaDB Vector: How it works. Part II

In the first post of this series, I’ve described how the vector index is stored in a table and how it achieves full transactional behavior and ACID properties compatible with the storage engine of the table the user created. But while the table provides persistent storage of the index, it’s in-memory part that gives it the performance. This is how it works.

Distance calculations

This is the most performance sensitive part of the HNSW. According to various estimates, distance calculations account for 80–90% of search time. And this operation time grows linearly with the vector length.

MariaDB Vector: How it works

You might have seen that MariaDB Vector is fast. And is getting faster. But why? How does it achieve that? And why it is said to use mHNSW (modified HNSW) algorithm? What did it modify in the conventional HNSW that all other databases are using? Let’s take it apart and analyze piece by piece.

Introduction into HNSW

This post is not a full description of HNSW, there are many HNSW descriptions online and they are good, better than what I could’ve written. I will only show the basic concepts beyond HNSW, concepts that are crucial for the rest of the post.

Big Vector Search Benchmark: 10 databases comparison

I have benchmarked MariaDB Vector before, but it was a while ago. Users kept asking about Milvus. New pgvector alternatives were gaining popularity. And I simply wanted to see if MariaDB got any better. This benchmark round includes more databases, larger dataset, and no irrelevant datasets that only add noise but don’t really help today in 2026.

Dataset

Now is the AI time. Vector search is used for embeddings generated by LLMs. Most ann-benchmarks datasets are pre-AI and use, for example, image transformations and filters to construct vectors. While useful for certain purposes, they are not the main use case for the MariaDB Vector and providing these results would be misleading and distracting from what matters to users.

Can you do RAG with Full Text Search in MariaDB?

We continue our blog series on learning more about users of MariaDB. Searching LinkedIn for posts about MariaDB this morning we saw an impressive confident post about using MariaDB in a RAG solution named SemantiQ. We got curious about it and reached out to the author Lorenzo Cremonese to have a chat.

Lorenzo’s post on LinkedIn

Tell us about yourself Lorenzo! 

I’m an Italian studying in Spain. I began programming when I was 14, and I’m now 22. I’m a self-taught web developer since 3-4 years ago, and I’m now doing a two year University education in Spain focused on web development at the institute IES ENRIC VALOR, in Pego. 

Finally here: MariaDB Vector Preview!

We’re here, we’re open source, and we have RDBMS based Vector Search for you! With the release of MariaDB 11.6 Vector Preview, the MariaDB Server ecosystem can finally check out how the long-awaited Vector Search functionality of MariaDB Server works. The effort is a result of collaborative work by employees of MariaDB plc, MariaDB Foundation and contributors, particularly from Amazon AWS. 

Previously on “MariaDB Vector”

If you’re new to Vector, this is what’s happened so far:

The main point: MariaDB Vector is ready for experimentation 

MariaDB Vector at Intel Vision – AI Everywhere

AI was everywhere at Intel Vision this week in London. Nearly every keynote and breakout presentation was centred around AI. I had the honour of being interviewed by Intel’s jovial Chief Commercial Officer Christoph Schell, who is just about as stereotypically German as his former neighbour from Stuttgart Jürgen Klopp (whom he referenced on-stage), namely: not at all.

Staying German but perhaps a tad less Klopp-like, Thomas Bach was one of many interviewed on-stage by Christoph. The president of the International Olympic Committee nevertheless impressed me by his quick-witted reply to Christoph’s question as to how AI would have made an impact if it had been in place during Thomas Bach’s fencing career.