MySQL indexes - 101 intro?

I worked with creating tables and keys, basic things. No experience with indexes. So the question is: do I need to manually create an index or automatically create it for MySQL for all the tables that I create?

If I need to create them, this means that any column with PK and FK needs to be indexed or this business logic is related to which columns need indexes and which don't.

+3
source share
2 answers

You need to create them yourself. PKs are actually indices, so there is no need to double the indices of these columns. And FKs can only be implemented with indexed columns ...

, :

- . . . , . , ...

+3

.

PK - , FK . ( FK)

, WHERE.

+2

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


All Articles