Shameless plug(s). To address both the problems you described, I have developed the following Postgres extensions.
Index Adviser can be used to automatically analyze your workload, and it will suggest the indexes that might help your queries perform better.
Postgres Plan Guarantee (under development) helps you generate+freeze a plan, and ensure that the Query Optimizer will never pick a different plan for your query.
Postgres Index Advisor: https://github.com/DrPostgres/pg_adviser
Postgres Plan Guarantee: https://github.com/DrPostgres/pg_plan_guarantee