[PATCH] Referenced generic plan mode

Started by Vlada Pogozhelskaya7 months ago1 messageshackers
Jump to latest
#1Vlada Pogozhelskaya
pogozhelskaya@gmail.com

Hi all,

I’d like to propose a patch that introduces a*referenced generic plan*mode.

The patch adds:

*

new EXPLAIN option|REF_GENERIC_PLAN|(not allowed with ANALYZE);

*

new|plan_cache_mode|values|ref_auto|and|force_ref_generic_plan|;

*

a flag to prevent constant folding of Params when building a generic
plan.

Generic and custom plan behavior stays unchanged unless the new option
is used.
Similar ideas exist in other systems: Oracle (Adaptive Cursor Sharing),
SQL Server (Parameter Sensitive Plan Optimization), and Db2 (REOPT).

I’ve attached the patch and a minimal regression test.

Best regards,
Vlada Pogozhelskaya

Attachments:

0001-Referenced-optimisation-of-Generic-plans.patchtext/plain; charset=UTF-8; name=0001-Referenced-optimisation-of-Generic-plans.patchDownload+141-9