[PATCH] Referenced generic plan mode

Started by Vlada Pogozhelskayaabout 1 year ago1 messageshackers

Thread notes

1 note#feature#moderate#enhancement
hackorum-bot#feature#moderate#enhancement
hackorum-bot
1 day ago

@global #feature #moderate #enhancement

#feature#moderate#enhancement
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:

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