Query plans management

Business-critical applications require continuous monitoring and adjustment of query plans. The problem hardens due the fact that actual resources consumption by query execution could differ significantly with slight changes of the query plan cost. Thus, there is a permanent risk of bad plan selection and overall system performance degradation after collecting new statistics. DBAs want to protect themselves from this risk by freezing plans of particular most critical queries.

Postgres Professional provides the sr_plan extension which allows to freeze plans of selected queries execution.  Currently it uses complete serialization/deserialization of query plans.  Negative side of such approach is in portability issues and sensitivity to schema changes.  We are looking for a better solution based on platform-independent “logical” serialization of execution plans which could also be less sensitive to schema changes.