E
E
evilelf2017-08-23 17:17:46
MySQL
evilelf, 2017-08-23 17:17:46

Is a foreign key an index?

Hello!
Is a Foreign Key an index in MySQL and PostreSQL?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
B
Boris Korobkov, 2017-08-23
@evilelf

Where it refers to - must be a unique index (preferably PK), without this FK will not be created.
Referenced from - MySQL automatically builds an index, but PostreSQL does not.
https://www.postgresql.org/docs/current/static/ddl...

L
lega, 2017-08-23
@lega

Foreign Key uses an index, i.e. No, but you can't do it without an index.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question