MySQL

Опубликовано: 22 Март 2025
на канале: Learnbatta
254
3

how to fix #mysql error #1553?
Let's say foreign key didn't have an index then if a new record is inserted then the foreign key constraint would require a full table scan on referenced table.
It takes more time it means lower performance
So, when creating a foreign key, the database checks if an index exists. If not an index will be created. By default, it will have the same name as the constraint.
When there is only one index that can be used for the foreign key, it can't be dropped.
If you really wan't to drop it, you either have to drop the foreign key constraint or to create another index for it first.