Re: PoC plpgsql - possibility to force custom or generic plan

Petr Jelinek <petr.jelinek@2ndquadrant.com>

From: Petr Jelinek <petr.jelinek@2ndquadrant.com>
To: Tom Lane <tgl@sss.pgh.pa.us>, Andres Freund <andres@anarazel.de>
Cc: Pavel Stehule <pavel.stehule@gmail.com>, David Steele <david@pgmasters.net>, PostgreSQL Hackers <pgsql-hackers@postgresql.org>, Jim Nasby <Jim.Nasby@bluetreble.com>
Date: 2017-04-06T07:04:06Z
Lists: pgsql-hackers
On 05/04/17 23:22, Tom Lane wrote:
> Andres Freund <andres@anarazel.de> writes:
>> I'd like some input from other committers whether we want this.  I'm
>> somewhat doubtful, but don't have particularly strong feelings.
> 
> I don't really want to expose the workings of the plancache at user level.
> The heuristics it uses certainly need work, 

That's an understatement, there are thousands of plpgsql functions in
large installations of PostgreSQL which use EXECUTE everywhere just to
avoid current behavior (and that's just what I've seen).

-- 
  Petr Jelinek                  http://www.2ndQuadrant.com/
  PostgreSQL Development, 24x7 Support, Training & Services


Commits

  1. Add plan_cache_mode setting

  2. Add some noreturn attributes to help static analyzers

  3. document when PREPARE uses generic plans

  4. Redesign the plancache mechanism for more flexibility and efficiency.