Re: Turn jit off for slow subquery in Postgres 12 - Mailing list pgsql-general

From Thomas Kellerer
Subject Re: Turn jit off for slow subquery in Postgres 12
Date
Msg-id a01f1cd1-4f23-de3e-bb60-fe9c2ecbe807@gmx.net
Whole thread Raw
In response to Turn jit off for slow subquery in Postgres 12  (Andrus <kobruleht2@hot.ee>)
Responses Re: Turn jit off for slow subquery in Postgres 12
List pgsql-general
Andrus schrieb am 16.02.2021 um 07:48:
> Last year I posted testcase [1] which shows that using jit makes execution
> magnitude slower ( 2.5s vs 0.4 sec) in typical shopping cart application product search in Postgres 12.
>
> There are also other reports on this [2,3].
>
> I tried to turn jit off for subquery using
>
> select ...  from
> (
> set jit to off;
> select ... from cartdata, ...  where ....
> set jit to on
> )
>
> But this cause syntax error.
>
> How to turn off jit for specific subquery in Postgres 12?

You can't.

You can only turn off JIT for the whole query (or the session).

In my experience, in OLTP type environments, JIT never improves a query.
We have turned it off globally.




pgsql-general by date:

Previous
From: Andrus
Date:
Subject: Turn jit off for slow subquery in Postgres 12
Next
From: Wolfgang Walther
Date:
Subject: Re: ALTER ROLE ... SET in current database only