Bug #120408 Feature Request: Complete vector search capabilities - distance functions, vector indexes and search
Submitted: 6 May 5:50 Modified: 6 May 9:04
Reporter: Hugo Wen Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: InnoDB storage engine Severity:S4 (Feature request)
Version: OS:Any
Assigned to: CPU Architecture:Any

[6 May 5:50] Hugo Wen
Description:
Current State (MySQL 9.7.0 Early Access Release 2):

The VECTOR data type works well for storage, along with TO_VECTOR(),
FROM_VECTOR(), and VECTOR_DIM(). However, DISTANCE(), VECTOR_DISTANCE(),
and vector indexes (HNSW, ScaNN) are not available in this release.

Competitive Landscape:

  Feature              MySQL 9.7.0-er2   MariaDB   PostgreSQL (pgvector)
  -------------------  ---------------   -------   ---------------------
  Vector storage       YES               YES       YES
  Distance functions   NO                YES       YES
  Vector indexes       NO                YES       YES (HNSW, IVFFlat)
  KNN/ANN search       NO                YES       YES
  Quantization         NO                NO        YES (halfvec, binary, sparse)
  BM25 hybrid search   NO                NO        YES (pg_search, VectorChord-bm25)
  Parallel idx builds  NO                NO        YES (7-9x speedup, up to 67x)

Observations from testing MySQL 9.7.0 Early Access Release 2:

The vector data type and basic conversion functions work well. The key gaps
are distance functions, vector indexes, and similarity search -- all of which
are available in MariaDB and PostgreSQL today. Without these, the VECTOR type
is storage-only with no query capability.

How to repeat:
  -- Vector storage works:
  CREATE TABLE embeddings (id INT PRIMARY KEY, vec VECTOR(768));
  INSERT INTO embeddings VALUES (1, TO_VECTOR('[0.1, 0.2, ...]'));
  SELECT VECTOR_DIM(vec) FROM embeddings;

  -- Distance functions NOT available

  -- Vector index NOT available

  -- Vector search NOT available:
[6 May 9:04] Roy Lyseng
Thank you for the useful feature request.