Eager-to-learn
Eager-to-learn

Reputation: 177

How to view the B-tree index structure generated by InnoDB of MySQL?

Is there a way to view the B-tree index structure generated by InnoDB when we specify B-tree index for an attribute of a table?

Upvotes: 2

Views: 1332

Answers (1)

Bill Karwin
Bill Karwin

Reputation: 562931

There are no official tools to view the internals of InnoDB B-tree index structures.

There's an experimental set of tools to examine the internals of InnoDB pages, but it won't display the B-tree in a human-readable way. https://github.com/jeremycole/innodb_ruby

But I believe you're asking for a thing that will not have useful information anyway.

https://dev.mysql.com/doc/refman/8.0/en/innodb-physical-structure.html says:

With the exception of spatial indexes, InnoDB indexes are B-tree data structures.

Specifying USING BTREE for the index type is redundant when using InnoDB. Whether you specify it or not, it will be a B-tree. There is no difference when you specify that index option.

Other storage engines (MEMORY, NDB) support HASH as an alternative index type.

See https://dev.mysql.com/doc/refman/8.0/en/create-index.html#create-index-storage-engine-index-types

Upvotes: 1

Related Questions