Re: PoC plpgsql - possibility to force custom or generic plan
Pavel Stehule <pavel.stehule@gmail.com>
From: Pavel Stehule <pavel.stehule@gmail.com>
To: Merlin Moncure <mmoncure@gmail.com>
Cc: Robert Haas <robertmhaas@gmail.com>, Tom Lane <tgl@sss.pgh.pa.us>, Peter Eisentraut <peter.eisentraut@2ndquadrant.com>,
Simon Riggs <simon@2ndquadrant.com>, Daniel Gustafsson <daniel@yesql.se>,
Andrew Dunstan <andrew.dunstan@2ndquadrant.com>, Andres Freund <andres@anarazel.de>,
Petr Jelinek <petr.jelinek@2ndquadrant.com>, David Steele <david@pgmasters.net>,
PostgreSQL Hackers <pgsql-hackers@postgresql.org>, Jim Nasby <Jim.Nasby@bluetreble.com>
Date: 2017-10-12T09:31:29Z
Lists: pgsql-hackers
Attachments
- guc-plancache_mode.patch (text/x-patch) patch
2017-09-19 20:49 GMT+02:00 Merlin Moncure <mmoncure@gmail.com>: > On Tue, Sep 19, 2017 at 1:37 PM, Robert Haas <robertmhaas@gmail.com> > wrote: > > On Tue, Sep 19, 2017 at 12:45 PM, Pavel Stehule <pavel.stehule@gmail.com> > wrote: > >>> You can already set a GUC with function scope. I'm not getting your > >>> point. > >> > >> yes, it is true. But implementation of #option is limited to PLpgSQL - > so > >> there is not any too much questions - GUC is global - there is lot of > >> points: > >> > >> * what is correct impact on PREPARE > >> * what is correct impact on EXECUTE > >> * what should be done if this GUC is changed .. > > > > For better or for worse, as a project we've settled on GUCs as a way > > to control behavior. I think it makes more sense to try to apply that > > option to new behaviors we want to control than to invent some new > > system. > > This seems very sensible. > > We also have infrastructure at the SQL level (SET) to manage the GUC. > Tom upthread (for pretty good reasons) extending SET to pl/pgsql > specific scoping but TBH I'm struggling as to why we need to implement > new syntax for this; the only thing missing is being able to scope SET > statements to a code block FWICT. > > here is a GUC based patch for plancache controlling. Looks so this code is working. It is hard to create regress tests. Any ideas? Regards Pavel > merlin >
Commits
-
Add plan_cache_mode setting
- f7cb2842bf47 12.0 landed
-
Add some noreturn attributes to help static analyzers
- a044378ce2f6 11.0 cited
-
document when PREPARE uses generic plans
- fab9d1da4a21 9.6.0 cited
-
Redesign the plancache mechanism for more flexibility and efficiency.
- e6faf910d750 9.2.0 cited