Prasad Weera
Prasad Weera

Reputation: 1299

Internal structure of combined key Indexing in SQL

After reading THIS answer on Indexing of tables, a doubt came up. Think we have a table with two columns and neither is unique but the combination. SO if I add a unique key like this, UNIQUE KEY (col1,col2) then how would the internal index file look like? I mean will it keep two separate b-trees or one single B-tree and if only one B-tree is made, then what would be the structure ?

And if my queries will be only on col1, then will this indexing be useful ?

Upvotes: 1

Views: 126

Answers (1)

Related Questions