Need to put @Index even when I'm checked with @Column (unique = true)?

Do I need to put @Index even if I am marked with @Column (unique = true)?

I have a property that will be often used to retrieve an object and wants to make it an index column in the database. So this property is already marked with @Column (unique = true), do I need to put @Index?

thank

+3
source share
2 answers

UNIQUE, UNIQUE INDEX, , UNIQUE . , .

, MySQL , a UNIQUE UNIQUE INDEX "" .

, .

+3

, mysql, mysql

- @Column (unique = true)

DDL unique (user_id)

mysql db user_id , @unique

0

Source: https://habr.com/ru/post/1771396/


All Articles