Skip to content

Usage & API Reference

Index Management

Build an Index:

CALL mysql.myvector_index_build('database.table.column', 'primary_key_column');

Check Index Status:

CALL mysql.myvector_index_status('database.table.column');

Drop an Index:

CALL mysql.myvector_index_drop('database.table.column');

Save and Load an Index:

-- Indexes are automatically saved. To load an index on startup:
CALL mysql.myvector_index_load('database.table.column');

Vector Functions

Create a Vector:

SET @my_vector = myvector_construct('[1.2, 3.4, 5.6]');

Calculate Distance:

SET @vec1 = myvector_construct('[1.2, 3.4, 5.6]');
SET @vec2 = myvector_construct('[1.0, 3.0, 5.0]');
SELECT myvector_distance(@vec1, @vec2, 'L2');

Display a Vector:

SELECT myvector_display(wordvec) FROM words50d LIMIT 1;

Docker Compose

Local trial only

As with the Quick Start, this uses a fixed password with the port bound to all interfaces. Fine for local trial use; use a real secret and bind to 127.0.0.1 for anything beyond that.

version: '3.8'

services:
  myvector:
    image: ghcr.io/askdba/myvector:mysql8.4
    ports:
      - "3306:3306"
    environment:
      MYSQL_ROOT_PASSWORD: myvector
      MYSQL_DATABASE: vectordb
    volumes:
      - myvector-data:/var/lib/mysql

volumes:
  myvector-data:

See Docker Images for the full list of available tags and Configuration for the full configuration reference.