Skip to content

MDEV-34805 provide various information about vector indexes#4955

Open
shabbann wants to merge 1 commit intoMariaDB:mainfrom
shabbann:MDEV-34805-provide-various-information-about-vector-indexes
Open

MDEV-34805 provide various information about vector indexes#4955
shabbann wants to merge 1 commit intoMariaDB:mainfrom
shabbann:MDEV-34805-provide-various-information-about-vector-indexes

Conversation

@shabbann
Copy link
Copy Markdown

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).

@shabbann shabbann force-pushed the MDEV-34805-provide-various-information-about-vector-indexes branch from 5d94591 to 2591dd6 Compare April 18, 2026 00:55
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).
@shabbann shabbann force-pushed the MDEV-34805-provide-various-information-about-vector-indexes branch from 2591dd6 to da6f17d Compare April 18, 2026 01:22
@vuvova vuvova requested review from Copilot and vuvova April 18, 2026 11:27
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_INDEXES schema-table plugin and row population logic in sql/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 thread sql/vector_mhnsw.cc
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;

Comment thread sql/vector_mhnsw.cc
}
size_t cache_mem_size()
{
return root_size(&root);
Comment thread sql/vector_mhnsw.cc
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);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants