Query is over 2x slower with jit=on
Andreas Joseph Krogh <andreas@visena.com>
From: Andreas Joseph Krogh <andreas@visena.com>
To: pgsql-hackers@lists.postgresql.org
Date: 2018-04-18T15:35:31Z
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: https://explain.depesz.com/s/vYB Planning Time: 0.336 ms JIT: 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: https://explain.depesz.com/s/X6mA 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 JOIN'ed. 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
Commits
-
Fix issues around EXPLAIN with JIT.
- e97c4d967ba5 11.0 landed
- c03c1449c092 12.0 landed
-
Collect JIT instrumentation from workers.
- e63441c3f5ca 11.0 landed
- 33001fd7a707 12.0 landed
-
Make EXPLAIN output for JIT compilation more dense.
- 6859bd2632d8 11.0 landed
- 52050ad8ebec 12.0 landed
-
Save/restore SPI's global variables in SPI_connect() and SPI_finish().
- 825f10fbda7a 11.0 cited
-
Rationalize handling of single and double quotes in bootstrap data.
- 55d26ff638f0 11.0 cited