Re: Query is over 2x slower with jit=on
Lukas Fittl <lukas@fittl.com>
From: Lukas Fittl <lukas@fittl.com>
To: Andres Freund <andres@anarazel.de>
Cc: Amit Khandekar <amitdkhan.pg@gmail.com>,
Andreas Joseph Krogh <andreas@visena.com>, Robert Haas <robertmhaas@gmail.com>,
Alvaro Herrera <alvherre@2ndquadrant.com>, "Jonathan S. Katz" <jkatz@postgresql.org>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2018-10-01T07:32:18Z
Lists: pgsql-hackers
Attachments
- fix-jit-statistics-in-EXPLAIN-for-non-parallel-queries-v1.patch (application/octet-stream) patch v1
On Tue, Sep 25, 2018 at 1:17 PM, Andres Freund <andres@anarazel.de> wrote: > > I've pushed the change without that bit - it's just a few additional > lines if we want to change that. > It seems that since this commit, JIT statistics are now only being printed for parallel query plans. This is due to ExplainPrintJIT being called before ExecutorEnd, so in a non-parallel query, queryDesc->estate->es_jit_combined_instr will never get set. Attached a patch that instead introduces a new ExplainPrintJITSummary method that summarizes the statistics before they get printed. I've also removed an (I believe) unnecessary "if (estate->es_instrument)" check that prevented EXPLAIN without ANALYZE from showing whether JIT would be used or not. In addition this also updates a missed section in the documentation with the new stats output format. Best, Lukas -- Lukas Fittl
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