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