Re: JIT overhead slowdown - Mailing list pgsql-performance

From Justin Pryzby
Subject Re: JIT overhead slowdown
Date
Msg-id 20190214210334.GA1732@telsasoft.com
Whole thread Raw
In response to JIT overhead slowdown  (Luis Carril <luis.carril@swarm64.com>)
List pgsql-performance
Hi,

On Fri, Jan 18, 2019 at 02:12:23PM +0000, Luis Carril wrote:
>     we noticed that in the presence of a schema with many partitions the jitting overhead penalizes the total query
executiontime so much that the planner should have decided not to jit at all. For example without jitting we go a 8.3 s
executiontime and with jitting enabled 13.8 s.
 
...
> Is this behavior expected? Is the cost function for jitting missing some circumstances?

On Fri, Jan 18, 2019 at 08:42:54AM -0800, Andres Freund wrote:
> The costing doesn't take the effect of overhead of repeated JITing in
> each worker into account.  I could give you a test patch that does, if
> you want to play around with it?

On Fri, Jan 18, 2019 at 06:02:43PM +0000, Luis Carril wrote:
>  yes please it would be much apreciated.

I'm also interested to try that ; on re-enabling JIT in 11.2, I see that JITed
queries seem to be universally slower than non-JIT.

I found that was discussed here:
https://www.postgresql.org/message-id/20180822161241.je6nghzjsktbb57b%40alap3.anarazel.de
https://www.postgresql.org/message-id/20180624203633.uxirvmigzdhcyjsd%40alap3.anarazel.de

Multiplying JIT cost by nworkers seems like an obvious thing to try, but I
wondered whether it's really correct?  Certainly repeated JITing takes N times
more CPU time, but doesn't make the query slower...unless the CPU resources are
starved and limiting ?

Justin


pgsql-performance by date:

Previous
From: Greg Stark
Date:
Subject: Re: Q on SQL Performance tuning
Next
From: Michael Lewis
Date:
Subject: Re: autovacuum big table taking hours and sometimes seconds