
Andromagelv
6 год назад
Найти индекс AlSO посчитайте
ОТВЕТЫ

Kiril
Nov 13, 2020
In MySQL a PRIMARY or UNIQUE KEY creates an index on the columns defined in the constraint. If there are multiple columns a composite index is created.
If its an InnoDB table the PRIMARY KEY also becomes the clustered index for the table.
It doesn't make sense to add additional indexes with the same definitions as a PRIMARY/UNIQUE.
For other RDBMS an index will be required for these constraints. Even if you are allowed to create a constraint without an appropriate index, it will be required to get any reasonable performance.
907