Definitely would be nice in pg. I think it exists for sql server (likely also oracle), iirc the db can even be configured to optimistically create the index to try it out, and revert it if it’s bad.
One of the difficulties is indexes have a write cost so heuristically deciding on the trade off can be complicated.