In MySQL if column X has unique values what's the difference between UNIQUE index and B-Tree index
-
01-11-2019 - |
Question
Let's assume that I have table data
:
CREATE TABLE `test`.`data` (
`row_id` INT NOT NULL ,
`data_id` INT NOT NULL ,
PRIMARY KEY (`row_id`) );
Now, let's assume that data_id has unique values. Is there any difference(space, performance, memory) between having B-Tree index on data_id
and UNIQUE index on it? (besides the case when InnoDB is used as storage engine and UNIQUE index can be used as clustering key so row_id is uneccesary)
No correct solution
Licensed under: CC-BY-SA with attribution
Not affiliated with dba.stackexchange