What does HackerNews think of pg_plan_guarantee?

Postgres Query Optimizer Extension that guarantees your desired plan will not change

Language: C

#30 in PostgreSQL
> A query ran for a long time without issue, and then, one day, some minor shift in your statistics happens, and now you have a major performance issue ..

This is the precise problem I’m working on solving. See the pg_plan_guarantee extension.

https://github.com/DrPostgres/pg_plan_guarantee

I don’t know if this directly answers your question, but Gurjeet is working on a Postgres extension that allows you to “lock in” a query plan: https://github.com/DrPostgres/pg_plan_guarantee
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