Answer the question
In order to leave comments, you need to log in
When to use a composite index on 2 fields, and when 2 indexes?
When in databases (tables) to use a composite index on 2 fields, and when 2 indexes (on the same fields, of course)?
(the number 2 is taken for simplicity)
does it depend on the type of the database?
Answer the question
In order to leave comments, you need to log in
Everything is very subtle here, I recently encountered a similar problem, the results can be read here . Is it possible to speed up a query to the database (add indexes)?
My conclusion is that you need to make indexes based on possible database queries based on your business logic (i.e. there are situations when you need to make 2 indexes, when one, and when it’s better not to do it) and field types (for dates, for example there are nuances).
Well, for different databases, most likely there are moments.
An index on two fields is needed if you are looking for your result on these two fields.
This is enough for you to start
https://otus.ru/events/subd_open/136/
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question