PostgreSQL: How to index all foreign keys?
- by biggusjimmus
I am working with a large PostgreSQL database, and I are trying to tune it to get more performance.
Our queries and updates seem to be doing a lot of lookups using foreign keys.
What I would like is a relatively simple way to add Indexes to all of our foreign keys without having to go through every table (~140) and doing it manually.
In researching this, I've come to find that there is no way to have Postgres do this for you automatically (like MySQL does), but I would be happy to hear otherwise there, too.