MariaDB: Codes Vectors & Visions 2025-05-06, Bremen (Germany)
Slides from Sergei Golubchik (MariaDB Foundation) hopefully here…
SQL> SHOW GLOBAL VARIABLES LIKE 'mhnsw%';
+------------------------+-----------+
| Variable_name | Value |
+------------------------+-----------+
| mhnsw_default_distance | euclidean |
| mhnsw_default_m | 6 |
| mhnsw_ef_search | 20 |
| mhnsw_max_cache_size | 16777216 |
+------------------------+-----------+
mhnsw_max_cache_sizemhnsw_default_distanceeuclidean or cosine→ cosine (Text)
→ Images euclidean
Depends on how the vectors were generated.
mhnsw_ef_search and mhnsw_default_mmhnsw_ef_search affexts only the search.
mhnsw_default_m affects both write and search.
M=3..5 ok
M=6 starts exponential growth
M=12 too high
Better to increase mhnsw_default_m than mhnsw_ef_search.
A bug should be:
my_message_sql(). See also Marcos comment