Query is over 2x slower with jit=on

From: Andreas Joseph Krogh <andreas(at)visena(dot)com>
To: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Query is over 2x slower with jit=on
Date: 2018-04-18 15:35:31
Message-ID: VisenaEmail.24.e60072a07f006130.162d95c3e17@tc7-visena
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Hi all.
I don't know whether this is expected or not but I'm experiencing over 2x
slowdown on a large query in PG-11 with JIT=on.
(query is a prepared statement executed with "explain analyze execute
myprepared(arg1, arg2, ..., argn)")
After 10 executions these are the results (the first 5 executed in > 16s, then
the plan changed)
With jit=on:
Planning Time: 0.336 ms
 Functions: 716
 Generation Time: 78.404 ms
 Inlining: false
 Inlining Time: 0.000 ms
 Optimization: false
 Optimization Time: 43.916 ms
 Emission Time: 600.031 ms
Execution Time: 2035.150 ms
(385 rows)
With jit=off:
Planning Time: 0.371 ms
Execution Time: 833.941 ms
(377 rows)
Both are master as of 55d26ff638f063fbccf57843f2c27f9795895a5c
The query largely consists of CTEs with aggregation which are FULL OUTER
On v10 the query executes in:
Execution time: 1159.628 ms
So v11 (with jit=off) is about 25% faster (due to parallel hash-join I think),
which is nice!
What's the deal with jit making it slower?
Andreas Joseph Krogh


Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2018-04-18 15:36:26 Re: Deadlock in multiple CIC.
Previous Message Tom Lane 2018-04-18 15:27:49 Re: Deadlock in multiple CIC.