pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Turn jit off for slow subquery in Postgres 12
3+ messages / 3 participants
[nested] [flat]

* Turn jit off for slow subquery in Postgres 12
@ 2021-02-16 06:48  Andrus <kobruleht2@hot.ee>
  0 siblings, 1 reply; 3+ messages in thread

From: Andrus @ 2021-02-16 06:48 UTC (permalink / raw)
  To: pgsql-general

Hi!

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 ?

Subquery is generated by EF Core and splitting it to multiple statements 
is not possible.

Postgres upgrade is not planned.

Andrus.

[1] 
https://www.postgresql.org/message-id/A2E2572094D4434CAEB57C80085B22C7@dell2
[2] 
https://www.postgresql.org/message-id/CAHOFxGo5xJt02RmwAWrtv2K0jcqqxG-cDiR8FQbvb0WxdKhcgw%40mail.gma...
[3]https://www.postgresql.org/message-id/629715.1595630222%40sss.pgh.pa.us

^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: Turn jit off for slow subquery in Postgres 12
@ 2021-02-16 06:52  Thomas Kellerer <shammat@gmx.net>
  parent: Andrus <kobruleht2@hot.ee>
  0 siblings, 1 reply; 3+ messages in thread

From: Thomas Kellerer @ 2021-02-16 06:52 UTC (permalink / raw)
  To: pgsql-general@lists.postgresql.org

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.






^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: Turn jit off for slow subquery in Postgres 12
@ 2021-02-16 15:21  Michael Lewis <mlewis@entrata.com>
  parent: Thomas Kellerer <shammat@gmx.net>
  0 siblings, 0 replies; 3+ messages in thread

From: Michael Lewis @ 2021-02-16 15:21 UTC (permalink / raw)
  To: Thomas Kellerer <shammat@gmx.net>; +Cc: PostgreSQL General <pgsql-general@lists.postgresql.org>

Either turn it off, or increase jit_above_cost, jit_inline_above_cost,
and/or jit_optimize_above_cost.

^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2021-02-16 15:21 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2021-02-16 06:48 Turn jit off for slow subquery in Postgres 12 Andrus <kobruleht2@hot.ee>
2021-02-16 06:52 ` Thomas Kellerer <shammat@gmx.net>
2021-02-16 15:21   ` Michael Lewis <mlewis@entrata.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox