Commit 8f32bacc authored by Tom Lane's avatar Tom Lane

In v11, disable JIT by default (it's still enabled by default in HEAD).

Per discussion, JIT isn't quite mature enough to ship enabled-by-default.

I failed to resist the temptation to do a bunch of copy-editing on the
related documentation.  Also, clean up some inconsistencies in which
section of config.sgml the JIT GUCs are documented in vs. what guc.c
and postgresql.config.sample had.

Discussion: https://postgr.es/m/20180914222657.mw25esrzbcnu6qlu@alap3.anarazel.de
parent 1f4a920b
......@@ -4155,7 +4155,6 @@ ANY <replaceable class="parameter">num_sync</replaceable> ( <replaceable class="
</listitem>
</varlistentry>
<varlistentry id="guc-jit-above-cost" xreflabel="jit_above_cost">
<term><varname>jit_above_cost</varname> (<type>floating point</type>)
<indexterm>
......@@ -4164,48 +4163,49 @@ ANY <replaceable class="parameter">num_sync</replaceable> ( <replaceable class="
</term>
<listitem>
<para>
Sets the planner's cutoff above which JIT compilation is used as part
of query execution (see <xref linkend="jit"/>). Performing
<acronym>JIT</acronym> costs time but can accelerate query execution.
Sets the query cost above which JIT compilation is activated, if
enabled (see <xref linkend="jit"/>).
Performing <acronym>JIT</acronym> costs planning time but can
accelerate query execution.
Setting this to <literal>-1</literal> disables JIT compilation.
The default is <literal>100000</literal>.
</para>
</listitem>
</varlistentry>
<varlistentry id="guc-jit-optimize-above-cost" xreflabel="jit_optimize_above_cost">
<term><varname>jit_optimize_above_cost</varname> (<type>floating point</type>)
<varlistentry id="guc-jit-inline-above-cost" xreflabel="jit_inline_above_cost">
<term><varname>jit_inline_above_cost</varname> (<type>floating point</type>)
<indexterm>
<primary><varname>jit_optimize_above_cost</varname> configuration parameter</primary>
<primary><varname>jit_inline_above_cost</varname> configuration parameter</primary>
</indexterm>
</term>
<listitem>
<para>
Sets the planner's cutoff above which JIT compiled programs (see <xref
linkend="guc-jit-above-cost"/>) are optimized. Optimization initially
takes time, but can improve execution speed. It is not meaningful to
set this to a lower value than <xref linkend="guc-jit-above-cost"/>.
Sets the query cost above which JIT compilation attempts to inline
functions and operators. Inlining adds planning time, but can
improve execution speed. It is not meaningful to set this to less
than <varname>jit_above_cost</varname>.
Setting this to <literal>-1</literal> disables inlining.
The default is <literal>500000</literal>.
</para>
</listitem>
</varlistentry>
<varlistentry id="guc-jit-inline-above-cost" xreflabel="jit_inline_above_cost">
<term><varname>jit_inline_above_cost</varname> (<type>floating point</type>)
<varlistentry id="guc-jit-optimize-above-cost" xreflabel="jit_optimize_above_cost">
<term><varname>jit_optimize_above_cost</varname> (<type>floating point</type>)
<indexterm>
<primary><varname>jit_inline_above_cost</varname> configuration parameter</primary>
<primary><varname>jit_optimize_above_cost</varname> configuration parameter</primary>
</indexterm>
</term>
<listitem>
<para>
Sets the planner's cutoff above which JIT compiled programs (see <xref
linkend="guc-jit-above-cost"/>) attempt to inline functions and
operators. Inlining initially takes time, but can improve execution
speed. It is unlikely to be beneficial to set
<varname>jit_inline_above_cost</varname> below
<varname>jit_optimize_above_cost</varname>.
Sets the query cost above which JIT compilation applies expensive
optimizations. Such optimization adds planning time, but can improve
execution speed. It is not meaningful to set this to less
than <varname>jit_above_cost</varname>, and it is unlikely to be
beneficial to set it to more
than <varname>jit_inline_above_cost</varname>.
Setting this to <literal>-1</literal> disables expensive optimizations.
The default is <literal>500000</literal>.
</para>
</listitem>
......@@ -4500,10 +4500,9 @@ SELECT * FROM parent WHERE key = 2400;
</term>
<listitem>
<para>
Determines whether <acronym>JIT</acronym> may be used by
Determines whether <acronym>JIT</acronym> compilation may be used by
<productname>PostgreSQL</productname>, if available (see <xref
linkend="jit"/>).
The default is <literal>on</literal>.
</para>
</listitem>
......@@ -7582,16 +7581,17 @@ SET XML OPTION { DOCUMENT | CONTENT };
</term>
<listitem>
<para>
Determines which JIT provider (see <xref linkend="jit-extensibility"/>) is
used. The built-in default is <literal>llvmjit</literal>.
This variable is the name of the JIT provider library to be used
(see <xref linkend="jit-pluggable"/>).
The default is <literal>llvmjit</literal>.
This parameter can only be set at server start.
</para>
<para>
If set to a non-existent library <acronym>JIT</acronym> will not be
If set to a non-existent library, <acronym>JIT</acronym> will not be
available, but no error will be raised. This allows JIT support to be
installed separately from the main
<productname>PostgreSQL</productname> package.
This parameter can only be set at server start.
</para>
</listitem>
</varlistentry>
......@@ -8886,9 +8886,8 @@ LOG: CleanUpLock: deleting: lock(0xb7acd844) id(24688,24696,0,0,0,1)
<para>
If LLVM has the required functionality, register generated functions
with <productname>GDB</productname>. This makes debugging easier.
The default setting is <literal>off</literal>, and can only be set at
server start.
The default setting is <literal>off</literal>.
This parameter can only be set at server start.
</para>
</listitem>
</varlistentry>
......@@ -8904,9 +8903,8 @@ LOG: CleanUpLock: deleting: lock(0xb7acd844) id(24688,24696,0,0,0,1)
Writes the generated <productname>LLVM</productname> IR out to the
file system, inside <xref linkend="guc-data-directory"/>. This is only
useful for working on the internals of the JIT implementation.
The default setting is <literal>off</literal>, and it can only be
changed by a superuser.
The default setting is <literal>off</literal>.
This parameter can only be changed by a superuser.
</para>
</listitem>
</varlistentry>
......@@ -8919,8 +8917,8 @@ LOG: CleanUpLock: deleting: lock(0xb7acd844) id(24688,24696,0,0,0,1)
</term>
<listitem>
<para>
Determines whether expressions are JIT compiled, subject to costing
decisions (see <xref linkend="jit-decision"/>). The default is
Determines whether expressions are JIT compiled, when JIT compilation
is activated (see <xref linkend="jit-decision"/>). The default is
<literal>on</literal>.
</para>
</listitem>
......@@ -8934,13 +8932,12 @@ LOG: CleanUpLock: deleting: lock(0xb7acd844) id(24688,24696,0,0,0,1)
</term>
<listitem>
<para>
If LLVM has the required functionality, emit required data to allow
If LLVM has the required functionality, emit the data needed to allow
<productname>perf</productname> to profile functions generated by JIT.
This writes out files to <filename>$HOME/.debug/jit/</filename>; the
user is responsible for performing cleanup when desired.
The default setting is <literal>off</literal>, and can only be set at
server start.
The default setting is <literal>off</literal>.
This parameter can only be set at server start.
</para>
</listitem>
</varlistentry>
......@@ -8953,9 +8950,9 @@ LOG: CleanUpLock: deleting: lock(0xb7acd844) id(24688,24696,0,0,0,1)
</term>
<listitem>
<para>
Determines whether tuple deforming is JIT compiled, subject to costing
decisions (see <xref linkend="jit-decision"/>). The default is
<literal>on</literal>.
Determines whether tuple deforming is JIT compiled, when JIT
compilation is activated (see <xref linkend="jit-decision"/>).
The default is <literal>on</literal>.
</para>
</listitem>
</varlistentry>
......
This diff is collapsed.
......@@ -85,8 +85,8 @@
<listitem>
<para>
JIT compilation of some SQL code, including support for fast evaluation
of expressions
Optional Just-in-Time (JIT) compilation of some SQL code, including
support for fast evaluation of expressions
</para>
</listitem>
......@@ -1076,10 +1076,16 @@ same commits as above
-->
<para>
Add <link linkend="jit">Just-In-Time</link>
Add <link linkend="jit">Just-in-Time</link>
(<acronym>JIT</acronym>) compilation of some parts of query plans
to improve execution speed (Andres Freund)
</para>
<para>
This feature requires <application>LLVM</application> to be
available, and it is not currently enabled by default, even in
builds that support it.
</para>
</listitem>
<listitem>
......
......@@ -33,7 +33,7 @@
/* GUCs */
bool jit_enabled = true;
char *jit_provider = "llvmjit";
char *jit_provider = NULL;
bool jit_debugging_support = false;
bool jit_dump_bitcode = false;
bool jit_expressions = true;
......
......@@ -3895,7 +3895,7 @@ static struct config_string ConfigureNamesString[] =
},
{
{"jit_provider", PGC_POSTMASTER, FILE_LOCATIONS,
{"jit_provider", PGC_POSTMASTER, CLIENT_CONN_PRELOAD,
gettext_noop("JIT provider to use."),
NULL,
GUC_SUPERUSER_ONLY
......
......@@ -320,11 +320,12 @@
#parallel_setup_cost = 1000.0 # same scale as above
#jit_above_cost = 100000 # perform JIT compilation if available
# and query more expensive, -1 disables
#jit_optimize_above_cost = 500000 # optimize JITed functions if query is
# more expensive, -1 disables
#jit_inline_above_cost = 500000 # attempt to inline operators and
# functions if query is more expensive,
# and query more expensive than this;
# -1 disables
#jit_inline_above_cost = 500000 # inline small functions if query is
# more expensive than this; -1 disables
#jit_optimize_above_cost = 500000 # use expensive JIT optimizations if
# query is more expensive than this;
# -1 disables
#min_parallel_table_scan_size = 8MB
......@@ -350,6 +351,7 @@
#join_collapse_limit = 8 # 1 disables collapsing of explicit
# JOIN clauses
#force_parallel_mode = off
#jit = on # allow JIT compilation
#plan_cache_mode = auto # auto, force_generic_plan or
# force_custom_plan
......@@ -616,13 +618,12 @@
#shared_preload_libraries = '' # (change requires restart)
#local_preload_libraries = ''
#session_preload_libraries = ''
#jit_provider = 'llvmjit' # JIT library to use
# - Other Defaults -
#dynamic_library_path = '$libdir'
#jit = on # allow JIT compilation
#jit_provider = 'llvmjit' # JIT implementation to use
#------------------------------------------------------------------------------
# LOCK MANAGEMENT
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment