(forked off from "Add missing JIT inline pass for llvm>=17")
On Mon, 19 Jan 2026 at 11:53, Pierre Ducroquet <[email protected]> wrote:
On Friday, January 16, 2026 10:29:59 AM Central European Standard Time Michael Banck wrote: > Hi, > > On Thu, Jan 15, 2026 at 12:26:23PM +0100, Álvaro Herrera wrote: > > On 2026-Jan-15, Andreas Karlsson wrote: > > > Great find! Sadly shows how little people actually use JIT. > > > > I disagree. Given that JIT is enabled by default, I think lots of > > people use it. > > Well, not sure about that - all of the three major hyperscalers disable > JIT in their managed Postgres offerings (or at least used to when I last > checked), and those are a major chunk of usage these days. Also, both > the RPM and (since recently) the Debian/Ubuntu community packages have > factored out the LLVM/jit part into their own packages and AFAIK they do > not get installed by default. > > So while the GUC is on by default, a lot of users might not use JIT > these days and not know either way. > > > What they don't do, is realize that things are slower > > than they could be -- much less try to figure out why. > > Right. People have also seen blog articles saying «JIT is bad, switch it off» that are right if you are in the wrong use cases for JIT. Which, to be fair, is not easy to figure out.
+1 on disabling jit by default. At the FOSDEM Postgres developer meeting consensus was hugely in favor of changing the default. So attached is a trivial patch that does this.
From 4e10f552e88087650bec97ee141b8dd70e74d405 Mon Sep 17 00:00:00 2001 From: Jelte Fennema-Nio <[email protected]> Date: Fri, 30 Jan 2026 11:58:50 +0100 Subject: [PATCH v1] Change default of jit to off While jit can speed up slow analytical queries, it can also cause huge slowdowns on otherwise very fast queries. This can be especially painful when due to some unrelated changes (e.g. a few additional INSERTs into a talbe) the plan is changed to use jit and then results in a huge performance cliff. That's why the default is already off on all hyperscalers. This changes our default to align with that that. --- doc/src/sgml/config.sgml | 3 ++- src/backend/jit/jit.c | 2 +- src/backend/utils/misc/guc_parameters.dat | 2 +- src/backend/utils/misc/postgresql.conf.sample | 2 +- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/doc/src/sgml/config.sgml b/doc/src/sgml/config.sgml index 5560b95ee60..e78ad2d3e25 100644 --- a/doc/src/sgml/config.sgml +++ b/doc/src/sgml/config.sgml @@ -6510,7 +6510,8 @@ SELECT * FROM parent WHERE key = 2400; 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>. + The default is <literal>off</literal> (before + <productname>PostgreSQL</productname> 19 the default was <literal>on</literal>). </para> </listitem> </varlistentry> diff --git a/src/backend/jit/jit.c b/src/backend/jit/jit.c index e92be36932b..1c6261096d0 100644 --- a/src/backend/jit/jit.c +++ b/src/backend/jit/jit.c @@ -29,7 +29,7 @@ #include "utils/fmgrprotos.h" /* GUCs */ -bool jit_enabled = true; +bool jit_enabled = false; char *jit_provider = NULL; bool jit_debugging_support = false; bool jit_dump_bitcode = false; diff --git a/src/backend/utils/misc/guc_parameters.dat b/src/backend/utils/misc/guc_parameters.dat index f0260e6e412..a164d92d439 100644 --- a/src/backend/utils/misc/guc_parameters.dat +++ b/src/backend/utils/misc/guc_parameters.dat @@ -1356,7 +1356,7 @@ short_desc => 'Allow JIT compilation.', flags => 'GUC_EXPLAIN', variable => 'jit_enabled', - boot_val => 'true', + boot_val => 'false', }, { name => 'jit_above_cost', type => 'real', context => 'PGC_USERSET', group => 'QUERY_TUNING_COST', diff --git a/src/backend/utils/misc/postgresql.conf.sample b/src/backend/utils/misc/postgresql.conf.sample index c4f92fcdac8..a277cf560ea 100644 --- a/src/backend/utils/misc/postgresql.conf.sample +++ b/src/backend/utils/misc/postgresql.conf.sample @@ -469,7 +469,7 @@ #constraint_exclusion = partition # on, off, or partition #cursor_tuple_fraction = 0.1 # range 0.0-1.0 #from_collapse_limit = 8 -#jit = on # allow JIT compilation +#jit = off # allow JIT compilation #join_collapse_limit = 8 # 1 disables collapsing of explicit # JOIN clauses #plan_cache_mode = auto # auto, force_generic_plan or base-commit: 1eb09ed63a8d8063dc6bb75c8f31ec564bf35250 -- 2.52.0
