summaryrefslogtreecommitdiff
path: root/doc/src
diff options
context:
space:
mode:
authorPeter Eisentraut <peter_e@gmx.net>2018-07-16 13:35:41 +0200
committerPeter Eisentraut <peter_e@gmx.net>2018-07-16 13:35:41 +0200
commitf7cb2842bf47715133b40e4a503f35dbe60d1b72 (patch)
tree645468d969635b10cb87e1134b60afcd26456339 /doc/src
parenta06e56b247feb2812bad5cf60fd9c0128d81f5c0 (diff)
Add plan_cache_mode setting
This allows overriding the choice of custom or generic plan. Author: Pavel Stehule <pavel.stehule@gmail.com> Discussion: https://www.postgresql.org/message-id/flat/CAFj8pRAGLaiEm8ur5DWEBo7qHRWTk9HxkuUAz00CZZtJj-LkCA%40mail.gmail.com
Diffstat (limited to 'doc/src')
-rw-r--r--doc/src/sgml/config.sgml30
1 files changed, 30 insertions, 0 deletions
diff --git a/doc/src/sgml/config.sgml b/doc/src/sgml/config.sgml
index e307bb4e8e9..4d48d93305a 100644
--- a/doc/src/sgml/config.sgml
+++ b/doc/src/sgml/config.sgml
@@ -4616,6 +4616,36 @@ SELECT * FROM parent WHERE key = 2400;
</listitem>
</varlistentry>
+ <varlistentry id="guc-plan-cache_mode" xreflabel="plan_cache_mode">
+ <term><varname>plan_cache_mode</varname> (<type>enum</type>)
+ <indexterm>
+ <primary><varname>plan_cache_mode</varname> configuration parameter</primary>
+ </indexterm>
+ </term>
+ <listitem>
+ <para>
+ Prepared statements (either explicitly prepared or implicitly
+ generated, for example in PL/pgSQL) can be executed using custom or
+ generic plans. A custom plan is replanned for a new parameter value,
+ a generic plan is reused for repeated executions of the prepared
+ statement. The choice between them is normally made automatically.
+ This setting overrides the default behavior and forces either a custom
+ or a generic plan. This can be used to work around performance
+ problems in specific cases. Note, however, that the plan cache
+ behavior is subject to change, so this setting, like all settings that
+ force the planner's hand, should be reevaluated regularly.
+ </para>
+
+ <para>
+ The allowed values are <literal>auto</literal>,
+ <literal>force_custom_plan</literal> and
+ <literal>force_generic_plan</literal>. The default value is
+ <literal>auto</literal>. The setting is applied when a cached plan is
+ to be executed, not when it is prepared.
+ </para>
+ </listitem>
+ </varlistentry>
+
</variablelist>
</sect2>
</sect1>