Re: Query is over 2x slower with jit=on - Mailing list pgsql-hackers

From Andres Freund
Subject Re: Query is over 2x slower with jit=on
Date
Msg-id 20181003195646.zup2kwrjtcnwzkjz@alap3.anarazel.de
Whole thread Raw
In response to Re: Query is over 2x slower with jit=on  (Lukas Fittl <lukas@fittl.com>)
List pgsql-hackers
Hi,

On 2018-10-01 00:32:18 -0700, Lukas Fittl wrote:
> 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.

Ugh.


> Attached a patch that instead introduces a new ExplainPrintJITSummary
> method that summarizes the statistics before they get printed.

Yea, I had something like that, and somehow concluded that it wasn't
needed, and moved it to the wrong place :/.


> 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.

Thanks a lot for the patch!  I've pushed it with some mild changes
(renamed es_jit_combined_stats to worker_stats; changed
ExplainPrintJITSummary to not look at es_jit, but es_jit_flags as
theoretically es_jit might not be allocated; very minor comment
changes).


- Andres


pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Shouldn't ExecShutdownNode() be called fromstandard_ExecutorFinish()?
Next
From: Tom Lane
Date:
Subject: Re: executor relation handling