Re: BUG #16183: PREPARED STATEMENT slowed down by jit

From: Jeff Janes <jeff(dot)janes(at)gmail(dot)com>
To: github(at)cquest(dot)org, pgsql-bugs <pgsql-bugs(at)lists(dot)postgresql(dot)org>
Subject: Re: BUG #16183: PREPARED STATEMENT slowed down by jit
Date: 2020-01-02 18:00:20
Message-ID: CAMkU=1yApeBH0ajaAPa35sD7t==LY=YmACcXXOGG18GwqzNung@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

>
> The update tool (osm2pgsql) makes heavy use of PREPARED statements. Could
> there be a bug in jit+PREPARED causing the statement to be recompiled on
> each execute ?
>

I don't think that that is a bug, rather it is just how JIT works at the
moment (that it is recompiled for each execution). That might be improved
in a future version.

For the slow down to be 10x though does seem rather extreme. Could you
isolate the query and post an execution with "EXPLAIN (ANALYZE)"? I
suspect it is a very cheap query (e.g. a single-row update), but for some
reason the planner thinks it is expensive, and so JIT kicks in when it
shouldn't. Because of the high overhead, JIT is only supposed to activate
for expensive queries, see jit_above_cost.

Cheers,

Jeff

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Christian Quest 2020-01-02 21:29:31 Re: BUG #16183: PREPARED STATEMENT slowed down by jit
Previous Message Tom Lane 2020-01-02 15:33:15 Re: BUG #16184: Segmentation Fault during update