As in PostgreSql to correctly set the indexes?

How to set indexes in the database, so as not to hurt performance? Correctly put on a foreign key column? Is it right to put on each column that can participate in the where clause?
April 19th 20 at 12:17
1 answer
April 19th 20 at 12:19
Solution
Abstract question = abstract answer.

Each index will slow down writing data.
Each index will slightly slow down the planning request.
Each index how much something weighs.
Suitable for a query, the index will significantly speed up the query.
Suitable for FK index will speed up this FK check when the write operations.
Index to frequently updated field will turn off hot update optimization.

Find the balance for your workload.

Find more questions by tags PostgreSQL