feat(volc_mysql): add VolcMySQL backend with HNSW vector index support#804
Open
FishMage wants to merge 1 commit into
Open
feat(volc_mysql): add VolcMySQL backend with HNSW vector index support#804FishMage wants to merge 1 commit into
FishMage wants to merge 1 commit into
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: FishMage The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Add a vector database backend for VolcMySQL (Volcano Engine MySQL with native VECTOR type and HNSW vector index), connecting via mysql-connector-python over the MySQL wire protocol. Components: - volc_mysql.py: VectorDB implementation with VECTOR(dim) table, bulk LOAD DATA LOCAL INFILE loading, and CREATE VECTOR INDEX via SECONDARY_ENGINE_ATTRIBUTE (algorithm/distance/m/ef_construction and optional quant_algorithm/quant_type for SQ/PQ) - config.py: DBConfig (host/port/user/password) and VolcMySQLHNSWConfig (m/ef_search/ef_construction + quantization params) - cli.py: Click command `VolcMySQLHNSW` Registration: - Add VolcMySQL to the DB enum in backend/clients/__init__.py with lazy imports for init_cls, config_cls, and case_config_cls - Register VolcMySQLHNSW CLI command in cli/vectordbbench.py - Add volc_mysql optional dependency in pyproject.toml Binary VECTOR path with auto-probe fallback: - Vectors are sent as raw little-endian float32 bytes (UNHEX on load, the `_binary` introducer on query), avoiding to_vector() text parsing and Python str() formatting; `_binary` literals stay constant-foldable so the HNSW index scan is preserved - init() probes once per connection (session-local TEMPORARY TABLE) whether the server accepts the binary path and transparently falls back to the to_vector() text path -- for both insert and query -- when it does not. VDB_BINARY_VEC overrides the probe (1=force binary, 0=force text) - Recall is identical between the two paths (0.9786 vs 0.9773 on 1536D50K) Tests: tests/test_volc_mysql_encoder.py covers binary and text TSV encoding.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add a vector database backend for VolcMySQL (Volcano Engine MySQL with native VECTOR type and HNSW vector index), connecting via mysql-connector-python over the MySQL wire protocol.
Components:
VolcMySQLHNSWRegistration:
Binary VECTOR path with auto-probe fallback:
_binaryintroducer on query), avoiding to_vector() text parsing and Python str() formatting;_binaryliterals stay constant-foldable so the HNSW index scan is preservedTests: tests/test_volc_mysql_encoder.py covers binary and text TSV encoding.