D.TS
D.TS

Reputation: 17

How many b+ trees does MySQL have when one table has many different indexes?

The MySQL InnoDB engine is based on a clustered index, all records and index data are stored in the index. So I am wondering where the secondary index is stored? In a different b+tree?

Please help!

Upvotes: 1

Views: 71

Answers (1)

Rick James
Rick James

Reputation: 142306

The PRIMARY KEY (which is 'clustered') is stored with the data in one BTree. Each secondary index is stored in another BTree. For more details, search this stackoverflow for my answers to similar questions.

Upvotes: 1

Related Questions