SQL-Query to retrieve column names in the public schema that are foreign keys but do not have an index
I’m working on optimizing database accesses in my PostgreSQL 15 database. I want to identify columns in tables within the public schema that are foreign keys but do not have an index associated with them. This information will help me prioritize adding indexes to improve query performance. Could someone provide a PostgreSQL query that returns the table name and column name of such columns?