Re: Turn jit off for slow subquery in Postgres 12

From: Thomas Kellerer <shammat(at)gmx(dot)net>
To: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: Turn jit off for slow subquery in Postgres 12
Date: 2021-02-16 06:52:09
Message-ID: a01f1cd1-4f23-de3e-bb60-fe9c2ecbe807@gmx.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Wolfgang Walther 2021-02-16 08:41:07 Re: ALTER ROLE ... SET in current database only
Previous Message Andrus 2021-02-16 06:48:35 Turn jit off for slow subquery in Postgres 12