MDEV-34805 provide various information about vector indexes#4955
Open
shabbann wants to merge 1 commit intoMariaDB:mainfrom
Open
MDEV-34805 provide various information about vector indexes#4955shabbann wants to merge 1 commit intoMariaDB:mainfrom
shabbann wants to merge 1 commit intoMariaDB:mainfrom
Conversation
5d94591 to
2591dd6
Compare
Adds INFORMATION_SCHEMA.VECTOR_INDEXES table exposing statistics for MHNSW vector indexes via a MYSQL_INFORMATION_SCHEMA_PLUGIN registered alongside the existing mhnsw daemon plugin. columns covered: (TABLE_SCHEMA, TABLE_NAME, INDEX_NAME, VECTOR_DIMENSIONS, SUBDIST_ENABLED, INDEX_SIZE, TOTAL_NODES, DELETED_ROWS, MEMORY_SIZE, CACHE_OVERFLOWS).
2591dd6 to
da6f17d
Compare
There was a problem hiding this comment.
Pull request overview
Adds an INFORMATION_SCHEMA.VECTOR_INDEXES table to expose runtime/disk statistics for MHNSW vector indexes, implemented as a MYSQL_INFORMATION_SCHEMA_PLUGIN registered alongside the existing mhnsw daemon plugin.
Changes:
- Add
INFORMATION_SCHEMA.VECTOR_INDEXESschema-table plugin and row population logic insql/vector_mhnsw.cc. - Track MHNSW cache overflow events and expose cache memory/node statistics.
- Add MTR coverage for the new I_S table and update expected outputs.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| sql/vector_mhnsw.cc | Adds I_S plugin/table definition + row filler; tracks cache overflows and exposes cache stats. |
| mysql-test/main/vector.test | Adds end-to-end test coverage for INFORMATION_SCHEMA.VECTOR_INDEXES. |
| mysql-test/main/vector.result | Captures expected output for the new test section. |
| mysql-test/main/information_schema.result | Updates global I_S table list expectations to include VECTOR_INDEXES. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+1863
to
+1867
| TABLE_SHARE *graph_share= share->hlindex; | ||
| auto ctx= graph_share | ||
| ? static_cast<MHNSW_Share*>(graph_share->hlindex_data) | ||
| : nullptr; | ||
|
|
| } | ||
| size_t cache_mem_size() | ||
| { | ||
| return root_size(&root); |
Comment on lines
+1921
to
+1925
| //approximate TOTAL_NODES | ||
| ulonglong disk_nodes= graph_file | ||
| ? (ulonglong)graph_file->stats.records | ||
| : 0; | ||
| out_table->field[5]->store(disk_nodes, true); |
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.
Adds INFORMATION_SCHEMA.VECTOR_INDEXES table exposing statistics for MHNSW vector indexes via a MYSQL_INFORMATION_SCHEMA_PLUGIN registered alongside the existing mhnsw daemon plugin. columns covered: (TABLE_SCHEMA, TABLE_NAME, INDEX_NAME, VECTOR_DIMENSIONS, SUBDIST_ENABLED, INDEX_SIZE, TOTAL_NODES, DELETED_ROWS, MEMORY_SIZE, CACHE_OVERFLOWS).