Creating an index always comes at the expense of: the more indexes you have in the table, the more expensive it is to change this table (i.e. inserting, updating, and deleting takes longer).
In turn, queries that can use indexes will be faster. This is a classic compromise. In most tables, a small number of commonly used indexes are costly because queries occur quite often (or their performance is much more important than modification performance).
On the other hand, if you have some kind of log table that is updated very often, but is only requested very rarely (for example, in the event of a catastrophic failure), then adding an index would add a lot of value and provide a very small advantage.
Also: regardless of whether the index is useful, a lot depends on the exact query that needs to be executed. You may have indexes spanning each column, but the query cannot use it because the indexes are in the wrong order, have the wrong information, or the wrong format. Therefore, not all indexes help all queries.
Joachim sauer
source share