Percona Server for MySQL 9.7.2-2 introduces DISTANCE() and VECTOR_DISTANCE() functions, enabling direct SQL-based vector similarity scoring. These functions support COSINE, EUCLIDEAN, MANHATTAN, and DOT metrics, allowing embeddings to be ranked or filtered without external services. While ANN indexing remains a future milestone, this update provides the immediate compute primitive for similarity operations.
- DISTANCE() enables SQL-native vector ranking using COSINE, EUCLIDEAN, MANHATTAN, or DOT metrics.
- Eliminates need for external vector DBs for basic similarity scoring and filtering.
- Provides foundational layer for future ANN indexing support like HNSW and IVF.
- Allows embedding comparison directly within MySQL queries for application logic.