SlideShare a Scribd company logo
Boosting MySQL with Vector Search
Scale22X 2025
Introducing the MyVector Plugin
Alkin Tezuysal
Let’s get connected!
Alkin Tezuysal - Director of Services @AltinityDB
● Linkedin : https://www.linkedin.com/in/askdba/
Open Source Database Evangelist
● Previously ChistaDATA, PlanetScale, Percona and Pythian as Senior Technical Manager, SRE, DBA
● Earlier in life Enterprise DBA , Informix, Oracle, DB2 , SQL Server
● Recent Recognitions:
○ Most Influential in Database Community 2022 - The Redgate 100
○ MySQL Cookbook, 4th Edition 2022 - O'Reilly Media, Inc.
○ MySQL Rockstar 2023 - Oracle (MySQL Community)
○ Database Design and Modeling with PostgreSQL and MySQL 2024 - <Packt>
@ask_dba
@2025 Altinity, Inc.
Born to Sail, Forced to Work!
Sailing Trivia
What is the name of the horizontal spar that
extends from the mast to control the angle
of the sail?
Vectors and Dimensions
● Mathematical objects representing
magnitude and direction (velocity,
force)
● Vectors can be represented as
arrays or ordered lists of numbers
○ 2D (x, y), 3D (x, y, z), n-dimensional
(AI)
● Basically data points
● When dimensions increase data
points increase and they turn into
embeddings
@2025 Altinity, Inc.
Understanding Vector
Embeddings
● Vector Embeddings: Mathematical
representations of data in a
high-dimensional space.
● Capture semantic meaning and
relationships between words, phrases, or
other data.
● Enable more accurate and relevant search
results compared to traditional keyword
search.
● Power AI applications like semantic search,
recommendation systems, and chatbots.
● Data analysis and application functionality
@2025 Altinity, Inc.
Vector Embeddings
Transforming data into vectors in
a way that captures the semantic
meaning or relationships between
the data points. (The image on the
left shows a OpenAI vector
embedding for a Wikipedia article
using text-embedding-ada-002
Vector dimension is 1536)
@2025 Altinity, Inc.
OpenAI has another model text-embedding-3-large model provides
3,072-dimensional vector embeddings. P.S: Deep Seek can
generate embedding dimensions upto 8K!
Benefits of Vector
Search
● Efficient and relevant search results.
● Improved relevance for text and image
search.
● Semantic understanding.
● Supports AI-based applications.
● Leverage and unlock value from live
and historical business data in the
MySQL database : e.g conversation
logs, clinical records, support tickets,
persona descriptions, medical images,
product catalog, legal filings etc.
@2025 Altinity, Inc.
Vector Support Helps
● Traditional search struggles with
high-dimensional data and semantic
understanding.
● Inefficient for AI and ML applications
that rely on vector embeddings.
● Vector support enhances performance
and relevance for similarity searches.
● Enables new AI-driven applications
directly within MySQL.
● Unlocks advanced data analysis
techniques using vector embeddings.
@2025 Altinity, Inc.
Why Vector Search in MySQL?
● MySQL World’s number one open-source
relational database
● Vector search allows for more efficient and
relevant search results.
● Improved relevance for text and image search
with semantic understanding.
● MyVector plugin extends MySQL with vector
search capabilities.
● Supports a wide range of AI-based applications.
P.S: MySQL does not come with extensibility
interfaces to add new data types, and no support
to add new index types and to add new access
methods
@2025 Altinity, Inc.
Vector Search Use Cases
Use Cases:
Natural Language Processing (NLP): Words or
sentences are converted into vectors where similar
words or phrases are closer in vector space.
Recommender Systems: Items or users can be
embedded to find similarities or predict preferences.
Image Recognition: Images can be encoded into
vectors for tasks like similarity search or classification.
@2025 Altinity, Inc.
Vector Databases
Vector Database
Providers
● Pinecone
● Qdrant
● Milvus
● Weavite
● Chroma
Vector Store
Providers
● ClickHouse
● Elasticsearch
● Singlestore
● Typesense
● Others
○ MySQL
○ MariaDB
○ PostgreSQL
○ TiDB.
@2025 Altinity, Inc.
Vector Databases vs Traditional Databases
@2025 Altinity, Inc.
Vector Data Processing
@2025 Altinity, Inc.
MySQL Vector Plugin Architecture
The MyVector Plugin, discussed earlier,
leverages this architecture. Here's how it
fits:
● UDFs in the plugin: Adds vector-related
SQL functions.
● Data storage : Use varbinary in MySQL
8.x and VECTOR in MySQL 9.x.
● Indexing: Integrates vector similarity
search via HNSW indexing.
● Similarity Search - Intuitive syntax for
search using SQL
● Administration - Simple MySQL stored
procedures
@2025 Altinity, Inc.
MySQL Vector Plugin Build
/// get the MyVector sources
$ cd mysql-server/src/plugin
$ git clone https://github.com/p3io/myvector-dev/ ./myvector
/// Generate makefile for the new plugin
$ cd mysql-server/bld
$ cmake .. <other options used for this build >
/// Build the plugin
$ cd mysql-server/bld/plugin/myvector
$ make
@2025 Altinity, Inc.
MySQL Vector Plugin Install
/// Copy the MyVector plugin shared library to the MySQL installation
plugins
$ cp mysql-server/bld/plugin_output_directory/myvector.so
/usr/local/mysql/lib/plugin/
/// Register the MyVector plugin and create MyVector stored procedures.
$ cd mysql-server/plugin/myvector
/// Connect to 'mysql' database as 'root'
$ mysql -u root -p mysql
mysql> source myvectorplugin.sql
@2025 Altinity, Inc.
MySQL Vector Plugin Architecture
● MySQL V8.X - InnoDB + Plugin + Varbinary Data Type
● MySQL V9.X - InnoDB + Plugin + Vector Data Type
mysql> select udf_name from performance_schema.user_defined_functions
where udf_name like "myvector%" ;
+-----------------------------+
| udf_name |
+-----------------------------+ |
| myvector_is_valid |
| myvector_distance |
| myvector_display |
| myvector_ann_set |
| myvector_row_distance |
| myvector_construct |
+-----------------------------+
@2025 Altinity, Inc.
MyVector Features
High speed, parallel build of HNSW index
Specify recall v/s latency parameters : M, ef, ef_search
HNSW index is incrementally persisted after initial build
Online update of index via binlog read & parse of DMLs
HNSW Index is crash-safe and is recovered on MySQL
instance crash
Write amplification to redo log/undo log avoided
@2025 Altinity, Inc.
MySQL Vector Plugin Examples MySQL 8.X
Ref: https://nlp.stanford.edu/projects/glove/
@2025 Altinity, Inc.
mysql > create table words50d( wordid
int primary key,
word varchar(200),
wordvec MYVECTOR(type=HNSW,
dim=50,size=400000,
M=64,ef=100)
);
– Load the Data (insert …)
mysql> call
myvector_index_build
('test.words50d.wordvec','wordid');
MySQL Vector Plugin Examples MySQL 9.1
mysql > create table words50d(
wordid int primary key,
word varchar(200),
wordvec MYVECTOR(type=HNSW,
dim=50,size=400000,
M=64,ef=100)
);
– Load the Data (insert …)
mysql> call
myvector_index_build
('test.words50d.wordvec','wordid');
@2025 Altinity, Inc.
MySQL Vector Plugin Examples
myvector_construct(vector_string VARCHAR):
Purpose: Converts a human-readable vector string into a serialized binary format suitable for storage
in a VARBINARY / VECTOR column.
Usage Example:
INSERT INTO vectors_table (vector_column)
VALUES (myvector_construct('[0.1, 0.2, 0.3, ...]'));
@2025 Altinity, Inc.
MySQL Vector Plugin Examples
myvector_display(vector_col_expr VARBINARY/VECTOR):
Purpose: Transforms a binary-stored vector back into a human-readable string
representation.
Usage Example:
SELECT myvector_display(vector_column) AS readable_vector
FROM vectors_table;
@2025 Altinity, Inc.
MySQL Vector Plugin Examples
myvector_distance(vec1 VARBINARY/VECTOR, vec2 VARBINARY/VECTOR, disttype VARCHAR):
Purpose: Calculates the distance between two vectors using the specified distance metric ('L2',
'EUCLIDEAN', or 'IP' for inner product).
Usage Example:
mysql> select myvector_distance((select wordvec from words50d where word =
'school'), (select wordvec from words50d where word='institute'))G
*************************** 1. row ***************************
myvector_distance((select wordvec from words50d where word = 'school'), (select
wordvec from words50d where word='institute')): 25.51254653930664
1 row in set (0.36 sec)
@2025 Altinity, Inc.
MySQL Vector Plugin Examples
Similarity Search (ANN)
SELECT <column-list> FROM <table> WHERE
MYVECTOR_IS_ANN('vector_column','key column',
<search vector>, options)
// search vector(s) should first be inserted to <query_table>
SELECT <column-list> FROM
MYVECTOR_SEARCH[<base_table>, <key column>,
<vector_column>, <query_table>]
@2025 Altinity, Inc.
MySQL Vector Plugin Examples
myvector_ann_set(veccol VARCHAR, options VARCHAR, searchvec
VECTOR/VARBINARY):
Purpose: Returns a comma-separated list of IDs corresponding to the nearest neighbors
of a given search vector.
Usage Example:
SELECT myvector_ann_set('vector_column', 'options',
myvector_construct('[0.1, 0.2, 0.3, ...]')) AS neighbors FROM
vectors_table;
@2025 Altinity, Inc.
MySQL Vector Plugin Examples
Vector Index Administration - Stored Procedures
// build the index
CALL myvector_index_build('vector column', 'key column')
// check current status of the index - number of rows, parameters etc
CALL myvector_index_status('vector column')
// open/load the index into memory after a restart (if not marked
online)
CALL myvector_index_load('vector column')
// drop the the index
CALL myvector_index_drop('vector column')
@2025 Altinity, Inc.
Initial Benchmarking Results
Dataset : gist-960-euclidean
Initial Benchmarking Results
Dataset : dbpedia-openai-1000k-angular
Demo
https://github.com/p3io/myvector-dev/tree/main/demo
@2025 Altinity, Inc.
References
Introducing MyVector Plugin — Vector Storage & Similarity Search in MySQL - HNSW, ANN | Medium
Introducing MyVector Plugin — Vector Storage & Similarity Search in MySQL — Part 2 | by Shankar Iyer | Medium
https://medium.com/@shiyer22/myvector-plugin-part-3-nearest-neighbour-search-with-other-predicates-and-the-sql-o
ptimizer-7541bfaa3df9
MySQL Vector Datatype: create your operations (part 1)
MySQL Vector Datatype: create your operations (part 2) - lefred blog
O'Reilly/Safari Books
https://asciinema.org/a/KZeSifbD0QpHYmYUep5SiaCMA
https://asciinema.org/a/YTIg12ClZAh38qUcgsBUAdSA7
https://asciinema.org/a/4uro9wYgFijuwP3EdJvp0tRMj
https://asciinema.org/a/O7rNs2OzLXyUja0bwWcldXsX9
https://asciinema.org/a/RJs3CFbuShQGeXkCSxDDG0n3i
https://asciinema.org/a/6F0hDcnFT4XMqi5ALSeTNkCbO
https://fosdem.org/2025/schedule/event/fosdem-2025-4230-boosting-mysql-with-vector-search-introducing-the-myvect
or-plugin/
@2025 Altinity, Inc.

More Related Content

More from Alkin Tezuysal (20)

MySQL Cookbook: Recipes for Developers, Alkin Tezuysal and Sveta Smirnova - P...
MySQL Cookbook: Recipes for Developers, Alkin Tezuysal and Sveta Smirnova - P...MySQL Cookbook: Recipes for Developers, Alkin Tezuysal and Sveta Smirnova - P...
MySQL Cookbook: Recipes for Developers, Alkin Tezuysal and Sveta Smirnova - P...
Alkin Tezuysal
 
My first 90 days with ClickHouse.pdf
My first 90 days with ClickHouse.pdfMy first 90 days with ClickHouse.pdf
My first 90 days with ClickHouse.pdf
Alkin Tezuysal
 
KubeCon_NA_2021
KubeCon_NA_2021KubeCon_NA_2021
KubeCon_NA_2021
Alkin Tezuysal
 
Integrating best of breed open source tools to vitess orchestrator pleu21
Integrating best of breed open source tools to vitess  orchestrator   pleu21Integrating best of breed open source tools to vitess  orchestrator   pleu21
Integrating best of breed open source tools to vitess orchestrator pleu21
Alkin Tezuysal
 
Vitess: Scalable Database Architecture - Kubernetes Community Days Africa Ap...
Vitess: Scalable Database Architecture -  Kubernetes Community Days Africa Ap...Vitess: Scalable Database Architecture -  Kubernetes Community Days Africa Ap...
Vitess: Scalable Database Architecture - Kubernetes Community Days Africa Ap...
Alkin Tezuysal
 
How to shard MariaDB like a pro - FOSDEM 2021
How to shard MariaDB like a pro  - FOSDEM 2021How to shard MariaDB like a pro  - FOSDEM 2021
How to shard MariaDB like a pro - FOSDEM 2021
Alkin Tezuysal
 
Vitess - Data on Kubernetes
Vitess -  Data on Kubernetes  Vitess -  Data on Kubernetes
Vitess - Data on Kubernetes
Alkin Tezuysal
 
MySQL Ecosystem in 2020
MySQL Ecosystem in 2020MySQL Ecosystem in 2020
MySQL Ecosystem in 2020
Alkin Tezuysal
 
Introduction to Vitess on Kubernetes for MySQL - Webinar
Introduction to Vitess on Kubernetes for MySQL -  WebinarIntroduction to Vitess on Kubernetes for MySQL -  Webinar
Introduction to Vitess on Kubernetes for MySQL - Webinar
Alkin Tezuysal
 
When is Myrocks good? 2020 Webinar Series
When is Myrocks good? 2020 Webinar SeriesWhen is Myrocks good? 2020 Webinar Series
When is Myrocks good? 2020 Webinar Series
Alkin Tezuysal
 
Mysql 8 vs Mariadb 10.4 Webinar 2020 Feb
Mysql 8 vs Mariadb 10.4 Webinar 2020 FebMysql 8 vs Mariadb 10.4 Webinar 2020 Feb
Mysql 8 vs Mariadb 10.4 Webinar 2020 Feb
Alkin Tezuysal
 
Myrocks in the wild wild west! FOSDEM 2020
Myrocks in the wild wild west! FOSDEM 2020Myrocks in the wild wild west! FOSDEM 2020
Myrocks in the wild wild west! FOSDEM 2020
Alkin Tezuysal
 
Mysql 8 vs Mariadb 10.4 Highload++ 2019
Mysql 8 vs Mariadb 10.4 Highload++ 2019Mysql 8 vs Mariadb 10.4 Highload++ 2019
Mysql 8 vs Mariadb 10.4 Highload++ 2019
Alkin Tezuysal
 
When is MyRocks good?
When is MyRocks good? When is MyRocks good?
When is MyRocks good?
Alkin Tezuysal
 
How to upgrade like a boss to MySQL 8.0 - PLE19
How to upgrade like a boss to MySQL 8.0 -  PLE19How to upgrade like a boss to MySQL 8.0 -  PLE19
How to upgrade like a boss to MySQL 8.0 - PLE19
Alkin Tezuysal
 
Mysql ecosystem in 2019
Mysql ecosystem in 2019Mysql ecosystem in 2019
Mysql ecosystem in 2019
Alkin Tezuysal
 
How to upgrade like a boss to my sql 8.0?
How to upgrade like a boss to my sql 8.0?How to upgrade like a boss to my sql 8.0?
How to upgrade like a boss to my sql 8.0?
Alkin Tezuysal
 
PXC (Xtradb) Failure and Recovery
PXC (Xtradb) Failure and RecoveryPXC (Xtradb) Failure and Recovery
PXC (Xtradb) Failure and Recovery
Alkin Tezuysal
 
Securing your database servers from external attacks
Securing your database servers from external attacksSecuring your database servers from external attacks
Securing your database servers from external attacks
Alkin Tezuysal
 
Serverless
ServerlessServerless
Serverless
Alkin Tezuysal
 
MySQL Cookbook: Recipes for Developers, Alkin Tezuysal and Sveta Smirnova - P...
MySQL Cookbook: Recipes for Developers, Alkin Tezuysal and Sveta Smirnova - P...MySQL Cookbook: Recipes for Developers, Alkin Tezuysal and Sveta Smirnova - P...
MySQL Cookbook: Recipes for Developers, Alkin Tezuysal and Sveta Smirnova - P...
Alkin Tezuysal
 
My first 90 days with ClickHouse.pdf
My first 90 days with ClickHouse.pdfMy first 90 days with ClickHouse.pdf
My first 90 days with ClickHouse.pdf
Alkin Tezuysal
 
Integrating best of breed open source tools to vitess orchestrator pleu21
Integrating best of breed open source tools to vitess  orchestrator   pleu21Integrating best of breed open source tools to vitess  orchestrator   pleu21
Integrating best of breed open source tools to vitess orchestrator pleu21
Alkin Tezuysal
 
Vitess: Scalable Database Architecture - Kubernetes Community Days Africa Ap...
Vitess: Scalable Database Architecture -  Kubernetes Community Days Africa Ap...Vitess: Scalable Database Architecture -  Kubernetes Community Days Africa Ap...
Vitess: Scalable Database Architecture - Kubernetes Community Days Africa Ap...
Alkin Tezuysal
 
How to shard MariaDB like a pro - FOSDEM 2021
How to shard MariaDB like a pro  - FOSDEM 2021How to shard MariaDB like a pro  - FOSDEM 2021
How to shard MariaDB like a pro - FOSDEM 2021
Alkin Tezuysal
 
Vitess - Data on Kubernetes
Vitess -  Data on Kubernetes  Vitess -  Data on Kubernetes
Vitess - Data on Kubernetes
Alkin Tezuysal
 
MySQL Ecosystem in 2020
MySQL Ecosystem in 2020MySQL Ecosystem in 2020
MySQL Ecosystem in 2020
Alkin Tezuysal
 
Introduction to Vitess on Kubernetes for MySQL - Webinar
Introduction to Vitess on Kubernetes for MySQL -  WebinarIntroduction to Vitess on Kubernetes for MySQL -  Webinar
Introduction to Vitess on Kubernetes for MySQL - Webinar
Alkin Tezuysal
 
When is Myrocks good? 2020 Webinar Series
When is Myrocks good? 2020 Webinar SeriesWhen is Myrocks good? 2020 Webinar Series
When is Myrocks good? 2020 Webinar Series
Alkin Tezuysal
 
Mysql 8 vs Mariadb 10.4 Webinar 2020 Feb
Mysql 8 vs Mariadb 10.4 Webinar 2020 FebMysql 8 vs Mariadb 10.4 Webinar 2020 Feb
Mysql 8 vs Mariadb 10.4 Webinar 2020 Feb
Alkin Tezuysal
 
Myrocks in the wild wild west! FOSDEM 2020
Myrocks in the wild wild west! FOSDEM 2020Myrocks in the wild wild west! FOSDEM 2020
Myrocks in the wild wild west! FOSDEM 2020
Alkin Tezuysal
 
Mysql 8 vs Mariadb 10.4 Highload++ 2019
Mysql 8 vs Mariadb 10.4 Highload++ 2019Mysql 8 vs Mariadb 10.4 Highload++ 2019
Mysql 8 vs Mariadb 10.4 Highload++ 2019
Alkin Tezuysal
 
When is MyRocks good?
When is MyRocks good? When is MyRocks good?
When is MyRocks good?
Alkin Tezuysal
 
How to upgrade like a boss to MySQL 8.0 - PLE19
How to upgrade like a boss to MySQL 8.0 -  PLE19How to upgrade like a boss to MySQL 8.0 -  PLE19
How to upgrade like a boss to MySQL 8.0 - PLE19
Alkin Tezuysal
 
Mysql ecosystem in 2019
Mysql ecosystem in 2019Mysql ecosystem in 2019
Mysql ecosystem in 2019
Alkin Tezuysal
 
How to upgrade like a boss to my sql 8.0?
How to upgrade like a boss to my sql 8.0?How to upgrade like a boss to my sql 8.0?
How to upgrade like a boss to my sql 8.0?
Alkin Tezuysal
 
PXC (Xtradb) Failure and Recovery
PXC (Xtradb) Failure and RecoveryPXC (Xtradb) Failure and Recovery
PXC (Xtradb) Failure and Recovery
Alkin Tezuysal
 
Securing your database servers from external attacks
Securing your database servers from external attacksSecuring your database servers from external attacks
Securing your database servers from external attacks
Alkin Tezuysal
 

Recently uploaded (20)

The truth behind the numbers: spotting statistical misuse.pptx
The truth behind the numbers: spotting statistical misuse.pptxThe truth behind the numbers: spotting statistical misuse.pptx
The truth behind the numbers: spotting statistical misuse.pptx
andyprosser3
 
Cost sheet. with basics and formats of sheet
Cost sheet. with basics and formats of sheetCost sheet. with basics and formats of sheet
Cost sheet. with basics and formats of sheet
supreetk82004
 
stages-of-moral-development-lawrence-kohlberg-pdf-free.pdf
stages-of-moral-development-lawrence-kohlberg-pdf-free.pdfstages-of-moral-development-lawrence-kohlberg-pdf-free.pdf
stages-of-moral-development-lawrence-kohlberg-pdf-free.pdf
esguerramark1991
 
Introduction Lecture 01 Data Science.pdf
Introduction Lecture 01 Data Science.pdfIntroduction Lecture 01 Data Science.pdf
Introduction Lecture 01 Data Science.pdf
messagetome133
 
MLecture 1 Introduction to AI . The basics.pptx
MLecture 1 Introduction to AI . The basics.pptxMLecture 1 Introduction to AI . The basics.pptx
MLecture 1 Introduction to AI . The basics.pptx
FaizaKhan720183
 
Stasiun kernel pabrik kelapa sawit indonesia
Stasiun kernel pabrik kelapa sawit indonesiaStasiun kernel pabrik kelapa sawit indonesia
Stasiun kernel pabrik kelapa sawit indonesia
fikrimanurung1
 
Presentation.2 .reversal. reversal. pptx
Presentation.2 .reversal. reversal. pptxPresentation.2 .reversal. reversal. pptx
Presentation.2 .reversal. reversal. pptx
siliaselim87
 
Class 3-Workforce profile updated P.pptx
Class 3-Workforce profile updated P.pptxClass 3-Workforce profile updated P.pptx
Class 3-Workforce profile updated P.pptx
angelananalucky
 
Kaggle & Datathons: A Practical Guide to AI Competitions
Kaggle & Datathons: A Practical Guide to AI CompetitionsKaggle & Datathons: A Practical Guide to AI Competitions
Kaggle & Datathons: A Practical Guide to AI Competitions
rasheedsrq
 
CH. 4.pptxt and I will be there in about
CH. 4.pptxt and I will be there in aboutCH. 4.pptxt and I will be there in about
CH. 4.pptxt and I will be there in about
miesoabdela57
 
加拿大成绩单购买原版(Dal毕业证书)戴尔豪斯大学毕业证文凭
加拿大成绩单购买原版(Dal毕业证书)戴尔豪斯大学毕业证文凭加拿大成绩单购买原版(Dal毕业证书)戴尔豪斯大学毕业证文凭
加拿大成绩单购买原版(Dal毕业证书)戴尔豪斯大学毕业证文凭
taqyed
 
19th Edition Of International Research Data Analysis Excellence Awards
19th Edition Of International Research Data Analysis Excellence Awards19th Edition Of International Research Data Analysis Excellence Awards
19th Edition Of International Research Data Analysis Excellence Awards
dataanalysisconferen
 
AI + Disability. Coded Futures: Better opportunities or biased outcomes?
AI + Disability. Coded Futures: Better opportunities or biased outcomes?AI + Disability. Coded Futures: Better opportunities or biased outcomes?
AI + Disability. Coded Futures: Better opportunities or biased outcomes?
Christine Hemphill
 
2025-03-03-Philly-AAAI-GoodData-Build Secure RAG Apps With Open LLM
2025-03-03-Philly-AAAI-GoodData-Build Secure RAG Apps With Open LLM2025-03-03-Philly-AAAI-GoodData-Build Secure RAG Apps With Open LLM
2025-03-03-Philly-AAAI-GoodData-Build Secure RAG Apps With Open LLM
Timothy Spann
 
vnptloveeeeeeeeeeeeeeeeeeeeeeeeeeee.pptx
vnptloveeeeeeeeeeeeeeeeeeeeeeeeeeee.pptxvnptloveeeeeeeeeeeeeeeeeeeeeeeeeeee.pptx
vnptloveeeeeeeeeeeeeeeeeeeeeeeeeeee.pptx
deomom129
 
Monitoring Imam Ririn di Pilkada Kota Depok 2024
Monitoring Imam Ririn di Pilkada Kota Depok 2024Monitoring Imam Ririn di Pilkada Kota Depok 2024
Monitoring Imam Ririn di Pilkada Kota Depok 2024
Deddy Rahman
 
Data-Models-in-DBMS-An-Overview.pptx.pptx
Data-Models-in-DBMS-An-Overview.pptx.pptxData-Models-in-DBMS-An-Overview.pptx.pptx
Data-Models-in-DBMS-An-Overview.pptx.pptx
hfebxtveyjxavhx
 
Design Data Model Objects for Analytics, Activation, and AI
Design Data Model Objects for Analytics, Activation, and AIDesign Data Model Objects for Analytics, Activation, and AI
Design Data Model Objects for Analytics, Activation, and AI
aaronmwinters
 
CloudMonitor - Architecture Audit Review February 2025.pdf
CloudMonitor - Architecture Audit Review February 2025.pdfCloudMonitor - Architecture Audit Review February 2025.pdf
CloudMonitor - Architecture Audit Review February 2025.pdf
Rodney Joyce
 
加拿大成绩单购买原版(UC毕业证书)卡尔加里大学毕业证文凭
加拿大成绩单购买原版(UC毕业证书)卡尔加里大学毕业证文凭加拿大成绩单购买原版(UC毕业证书)卡尔加里大学毕业证文凭
加拿大成绩单购买原版(UC毕业证书)卡尔加里大学毕业证文凭
taqyed
 
The truth behind the numbers: spotting statistical misuse.pptx
The truth behind the numbers: spotting statistical misuse.pptxThe truth behind the numbers: spotting statistical misuse.pptx
The truth behind the numbers: spotting statistical misuse.pptx
andyprosser3
 
Cost sheet. with basics and formats of sheet
Cost sheet. with basics and formats of sheetCost sheet. with basics and formats of sheet
Cost sheet. with basics and formats of sheet
supreetk82004
 
stages-of-moral-development-lawrence-kohlberg-pdf-free.pdf
stages-of-moral-development-lawrence-kohlberg-pdf-free.pdfstages-of-moral-development-lawrence-kohlberg-pdf-free.pdf
stages-of-moral-development-lawrence-kohlberg-pdf-free.pdf
esguerramark1991
 
Introduction Lecture 01 Data Science.pdf
Introduction Lecture 01 Data Science.pdfIntroduction Lecture 01 Data Science.pdf
Introduction Lecture 01 Data Science.pdf
messagetome133
 
MLecture 1 Introduction to AI . The basics.pptx
MLecture 1 Introduction to AI . The basics.pptxMLecture 1 Introduction to AI . The basics.pptx
MLecture 1 Introduction to AI . The basics.pptx
FaizaKhan720183
 
Stasiun kernel pabrik kelapa sawit indonesia
Stasiun kernel pabrik kelapa sawit indonesiaStasiun kernel pabrik kelapa sawit indonesia
Stasiun kernel pabrik kelapa sawit indonesia
fikrimanurung1
 
Presentation.2 .reversal. reversal. pptx
Presentation.2 .reversal. reversal. pptxPresentation.2 .reversal. reversal. pptx
Presentation.2 .reversal. reversal. pptx
siliaselim87
 
Class 3-Workforce profile updated P.pptx
Class 3-Workforce profile updated P.pptxClass 3-Workforce profile updated P.pptx
Class 3-Workforce profile updated P.pptx
angelananalucky
 
Kaggle & Datathons: A Practical Guide to AI Competitions
Kaggle & Datathons: A Practical Guide to AI CompetitionsKaggle & Datathons: A Practical Guide to AI Competitions
Kaggle & Datathons: A Practical Guide to AI Competitions
rasheedsrq
 
CH. 4.pptxt and I will be there in about
CH. 4.pptxt and I will be there in aboutCH. 4.pptxt and I will be there in about
CH. 4.pptxt and I will be there in about
miesoabdela57
 
加拿大成绩单购买原版(Dal毕业证书)戴尔豪斯大学毕业证文凭
加拿大成绩单购买原版(Dal毕业证书)戴尔豪斯大学毕业证文凭加拿大成绩单购买原版(Dal毕业证书)戴尔豪斯大学毕业证文凭
加拿大成绩单购买原版(Dal毕业证书)戴尔豪斯大学毕业证文凭
taqyed
 
19th Edition Of International Research Data Analysis Excellence Awards
19th Edition Of International Research Data Analysis Excellence Awards19th Edition Of International Research Data Analysis Excellence Awards
19th Edition Of International Research Data Analysis Excellence Awards
dataanalysisconferen
 
AI + Disability. Coded Futures: Better opportunities or biased outcomes?
AI + Disability. Coded Futures: Better opportunities or biased outcomes?AI + Disability. Coded Futures: Better opportunities or biased outcomes?
AI + Disability. Coded Futures: Better opportunities or biased outcomes?
Christine Hemphill
 
2025-03-03-Philly-AAAI-GoodData-Build Secure RAG Apps With Open LLM
2025-03-03-Philly-AAAI-GoodData-Build Secure RAG Apps With Open LLM2025-03-03-Philly-AAAI-GoodData-Build Secure RAG Apps With Open LLM
2025-03-03-Philly-AAAI-GoodData-Build Secure RAG Apps With Open LLM
Timothy Spann
 
vnptloveeeeeeeeeeeeeeeeeeeeeeeeeeee.pptx
vnptloveeeeeeeeeeeeeeeeeeeeeeeeeeee.pptxvnptloveeeeeeeeeeeeeeeeeeeeeeeeeeee.pptx
vnptloveeeeeeeeeeeeeeeeeeeeeeeeeeee.pptx
deomom129
 
Monitoring Imam Ririn di Pilkada Kota Depok 2024
Monitoring Imam Ririn di Pilkada Kota Depok 2024Monitoring Imam Ririn di Pilkada Kota Depok 2024
Monitoring Imam Ririn di Pilkada Kota Depok 2024
Deddy Rahman
 
Data-Models-in-DBMS-An-Overview.pptx.pptx
Data-Models-in-DBMS-An-Overview.pptx.pptxData-Models-in-DBMS-An-Overview.pptx.pptx
Data-Models-in-DBMS-An-Overview.pptx.pptx
hfebxtveyjxavhx
 
Design Data Model Objects for Analytics, Activation, and AI
Design Data Model Objects for Analytics, Activation, and AIDesign Data Model Objects for Analytics, Activation, and AI
Design Data Model Objects for Analytics, Activation, and AI
aaronmwinters
 
CloudMonitor - Architecture Audit Review February 2025.pdf
CloudMonitor - Architecture Audit Review February 2025.pdfCloudMonitor - Architecture Audit Review February 2025.pdf
CloudMonitor - Architecture Audit Review February 2025.pdf
Rodney Joyce
 
加拿大成绩单购买原版(UC毕业证书)卡尔加里大学毕业证文凭
加拿大成绩单购买原版(UC毕业证书)卡尔加里大学毕业证文凭加拿大成绩单购买原版(UC毕业证书)卡尔加里大学毕业证文凭
加拿大成绩单购买原版(UC毕业证书)卡尔加里大学毕业证文凭
taqyed
 

Boosting MySQL with Vector Search Scale22X 2025.pdf

  • 1. Boosting MySQL with Vector Search Scale22X 2025 Introducing the MyVector Plugin Alkin Tezuysal
  • 2. Let’s get connected! Alkin Tezuysal - Director of Services @AltinityDB ● Linkedin : https://www.linkedin.com/in/askdba/ Open Source Database Evangelist ● Previously ChistaDATA, PlanetScale, Percona and Pythian as Senior Technical Manager, SRE, DBA ● Earlier in life Enterprise DBA , Informix, Oracle, DB2 , SQL Server ● Recent Recognitions: ○ Most Influential in Database Community 2022 - The Redgate 100 ○ MySQL Cookbook, 4th Edition 2022 - O'Reilly Media, Inc. ○ MySQL Rockstar 2023 - Oracle (MySQL Community) ○ Database Design and Modeling with PostgreSQL and MySQL 2024 - <Packt> @ask_dba @2025 Altinity, Inc. Born to Sail, Forced to Work!
  • 3. Sailing Trivia What is the name of the horizontal spar that extends from the mast to control the angle of the sail?
  • 4. Vectors and Dimensions ● Mathematical objects representing magnitude and direction (velocity, force) ● Vectors can be represented as arrays or ordered lists of numbers ○ 2D (x, y), 3D (x, y, z), n-dimensional (AI) ● Basically data points ● When dimensions increase data points increase and they turn into embeddings @2025 Altinity, Inc.
  • 5. Understanding Vector Embeddings ● Vector Embeddings: Mathematical representations of data in a high-dimensional space. ● Capture semantic meaning and relationships between words, phrases, or other data. ● Enable more accurate and relevant search results compared to traditional keyword search. ● Power AI applications like semantic search, recommendation systems, and chatbots. ● Data analysis and application functionality @2025 Altinity, Inc.
  • 6. Vector Embeddings Transforming data into vectors in a way that captures the semantic meaning or relationships between the data points. (The image on the left shows a OpenAI vector embedding for a Wikipedia article using text-embedding-ada-002 Vector dimension is 1536) @2025 Altinity, Inc. OpenAI has another model text-embedding-3-large model provides 3,072-dimensional vector embeddings. P.S: Deep Seek can generate embedding dimensions upto 8K!
  • 7. Benefits of Vector Search ● Efficient and relevant search results. ● Improved relevance for text and image search. ● Semantic understanding. ● Supports AI-based applications. ● Leverage and unlock value from live and historical business data in the MySQL database : e.g conversation logs, clinical records, support tickets, persona descriptions, medical images, product catalog, legal filings etc. @2025 Altinity, Inc.
  • 8. Vector Support Helps ● Traditional search struggles with high-dimensional data and semantic understanding. ● Inefficient for AI and ML applications that rely on vector embeddings. ● Vector support enhances performance and relevance for similarity searches. ● Enables new AI-driven applications directly within MySQL. ● Unlocks advanced data analysis techniques using vector embeddings. @2025 Altinity, Inc.
  • 9. Why Vector Search in MySQL? ● MySQL World’s number one open-source relational database ● Vector search allows for more efficient and relevant search results. ● Improved relevance for text and image search with semantic understanding. ● MyVector plugin extends MySQL with vector search capabilities. ● Supports a wide range of AI-based applications. P.S: MySQL does not come with extensibility interfaces to add new data types, and no support to add new index types and to add new access methods @2025 Altinity, Inc.
  • 10. Vector Search Use Cases Use Cases: Natural Language Processing (NLP): Words or sentences are converted into vectors where similar words or phrases are closer in vector space. Recommender Systems: Items or users can be embedded to find similarities or predict preferences. Image Recognition: Images can be encoded into vectors for tasks like similarity search or classification. @2025 Altinity, Inc.
  • 11. Vector Databases Vector Database Providers ● Pinecone ● Qdrant ● Milvus ● Weavite ● Chroma Vector Store Providers ● ClickHouse ● Elasticsearch ● Singlestore ● Typesense ● Others ○ MySQL ○ MariaDB ○ PostgreSQL ○ TiDB. @2025 Altinity, Inc.
  • 12. Vector Databases vs Traditional Databases @2025 Altinity, Inc.
  • 14. MySQL Vector Plugin Architecture The MyVector Plugin, discussed earlier, leverages this architecture. Here's how it fits: ● UDFs in the plugin: Adds vector-related SQL functions. ● Data storage : Use varbinary in MySQL 8.x and VECTOR in MySQL 9.x. ● Indexing: Integrates vector similarity search via HNSW indexing. ● Similarity Search - Intuitive syntax for search using SQL ● Administration - Simple MySQL stored procedures @2025 Altinity, Inc.
  • 15. MySQL Vector Plugin Build /// get the MyVector sources $ cd mysql-server/src/plugin $ git clone https://github.com/p3io/myvector-dev/ ./myvector /// Generate makefile for the new plugin $ cd mysql-server/bld $ cmake .. <other options used for this build > /// Build the plugin $ cd mysql-server/bld/plugin/myvector $ make @2025 Altinity, Inc.
  • 16. MySQL Vector Plugin Install /// Copy the MyVector plugin shared library to the MySQL installation plugins $ cp mysql-server/bld/plugin_output_directory/myvector.so /usr/local/mysql/lib/plugin/ /// Register the MyVector plugin and create MyVector stored procedures. $ cd mysql-server/plugin/myvector /// Connect to 'mysql' database as 'root' $ mysql -u root -p mysql mysql> source myvectorplugin.sql @2025 Altinity, Inc.
  • 17. MySQL Vector Plugin Architecture ● MySQL V8.X - InnoDB + Plugin + Varbinary Data Type ● MySQL V9.X - InnoDB + Plugin + Vector Data Type mysql> select udf_name from performance_schema.user_defined_functions where udf_name like "myvector%" ; +-----------------------------+ | udf_name | +-----------------------------+ | | myvector_is_valid | | myvector_distance | | myvector_display | | myvector_ann_set | | myvector_row_distance | | myvector_construct | +-----------------------------+ @2025 Altinity, Inc.
  • 18. MyVector Features High speed, parallel build of HNSW index Specify recall v/s latency parameters : M, ef, ef_search HNSW index is incrementally persisted after initial build Online update of index via binlog read & parse of DMLs HNSW Index is crash-safe and is recovered on MySQL instance crash Write amplification to redo log/undo log avoided @2025 Altinity, Inc.
  • 19. MySQL Vector Plugin Examples MySQL 8.X Ref: https://nlp.stanford.edu/projects/glove/ @2025 Altinity, Inc. mysql > create table words50d( wordid int primary key, word varchar(200), wordvec MYVECTOR(type=HNSW, dim=50,size=400000, M=64,ef=100) ); – Load the Data (insert …) mysql> call myvector_index_build ('test.words50d.wordvec','wordid');
  • 20. MySQL Vector Plugin Examples MySQL 9.1 mysql > create table words50d( wordid int primary key, word varchar(200), wordvec MYVECTOR(type=HNSW, dim=50,size=400000, M=64,ef=100) ); – Load the Data (insert …) mysql> call myvector_index_build ('test.words50d.wordvec','wordid'); @2025 Altinity, Inc.
  • 21. MySQL Vector Plugin Examples myvector_construct(vector_string VARCHAR): Purpose: Converts a human-readable vector string into a serialized binary format suitable for storage in a VARBINARY / VECTOR column. Usage Example: INSERT INTO vectors_table (vector_column) VALUES (myvector_construct('[0.1, 0.2, 0.3, ...]')); @2025 Altinity, Inc.
  • 22. MySQL Vector Plugin Examples myvector_display(vector_col_expr VARBINARY/VECTOR): Purpose: Transforms a binary-stored vector back into a human-readable string representation. Usage Example: SELECT myvector_display(vector_column) AS readable_vector FROM vectors_table; @2025 Altinity, Inc.
  • 23. MySQL Vector Plugin Examples myvector_distance(vec1 VARBINARY/VECTOR, vec2 VARBINARY/VECTOR, disttype VARCHAR): Purpose: Calculates the distance between two vectors using the specified distance metric ('L2', 'EUCLIDEAN', or 'IP' for inner product). Usage Example: mysql> select myvector_distance((select wordvec from words50d where word = 'school'), (select wordvec from words50d where word='institute'))G *************************** 1. row *************************** myvector_distance((select wordvec from words50d where word = 'school'), (select wordvec from words50d where word='institute')): 25.51254653930664 1 row in set (0.36 sec) @2025 Altinity, Inc.
  • 24. MySQL Vector Plugin Examples Similarity Search (ANN) SELECT <column-list> FROM <table> WHERE MYVECTOR_IS_ANN('vector_column','key column', <search vector>, options) // search vector(s) should first be inserted to <query_table> SELECT <column-list> FROM MYVECTOR_SEARCH[<base_table>, <key column>, <vector_column>, <query_table>] @2025 Altinity, Inc.
  • 25. MySQL Vector Plugin Examples myvector_ann_set(veccol VARCHAR, options VARCHAR, searchvec VECTOR/VARBINARY): Purpose: Returns a comma-separated list of IDs corresponding to the nearest neighbors of a given search vector. Usage Example: SELECT myvector_ann_set('vector_column', 'options', myvector_construct('[0.1, 0.2, 0.3, ...]')) AS neighbors FROM vectors_table; @2025 Altinity, Inc.
  • 26. MySQL Vector Plugin Examples Vector Index Administration - Stored Procedures // build the index CALL myvector_index_build('vector column', 'key column') // check current status of the index - number of rows, parameters etc CALL myvector_index_status('vector column') // open/load the index into memory after a restart (if not marked online) CALL myvector_index_load('vector column') // drop the the index CALL myvector_index_drop('vector column') @2025 Altinity, Inc.
  • 27. Initial Benchmarking Results Dataset : gist-960-euclidean
  • 28. Initial Benchmarking Results Dataset : dbpedia-openai-1000k-angular
  • 30. References Introducing MyVector Plugin — Vector Storage & Similarity Search in MySQL - HNSW, ANN | Medium Introducing MyVector Plugin — Vector Storage & Similarity Search in MySQL — Part 2 | by Shankar Iyer | Medium https://medium.com/@shiyer22/myvector-plugin-part-3-nearest-neighbour-search-with-other-predicates-and-the-sql-o ptimizer-7541bfaa3df9 MySQL Vector Datatype: create your operations (part 1) MySQL Vector Datatype: create your operations (part 2) - lefred blog O'Reilly/Safari Books https://asciinema.org/a/KZeSifbD0QpHYmYUep5SiaCMA https://asciinema.org/a/YTIg12ClZAh38qUcgsBUAdSA7 https://asciinema.org/a/4uro9wYgFijuwP3EdJvp0tRMj https://asciinema.org/a/O7rNs2OzLXyUja0bwWcldXsX9 https://asciinema.org/a/RJs3CFbuShQGeXkCSxDDG0n3i https://asciinema.org/a/6F0hDcnFT4XMqi5ALSeTNkCbO https://fosdem.org/2025/schedule/event/fosdem-2025-4230-boosting-mysql-with-vector-search-introducing-the-myvect or-plugin/ @2025 Altinity, Inc.