This might already exist, but seems like AI would be a natural fit and efficient at recommending indexes based off queries. I’ve been building a Python SQLite3 app and I gave ChatGPT the entire schema along with all queries and it did a fantastic job at recommending queries and explaining them. Compound indexes, unique indexes, compound primary keys. Taken a step further, if a process ran live inspecting queries in real time and then sent notifications of missing indexes would be super useful.
I think you are describing Xata Agent :) https://github.com/xataio/agent It watches metrics/logs, queries pg_stat_stetements for slow queries, the sends slack notification with suggestions, including indexes, but can be more varied than that.