> Last year I posted testcase  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 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.