Re: BUG #16183: PREPARED STATEMENT slowed down by jit - Mailing list pgsql-bugs

From Jeff Janes
Subject Re: BUG #16183: PREPARED STATEMENT slowed down by jit
Date
Msg-id CAMkU=1yApeBH0ajaAPa35sD7t==LY=YmACcXXOGG18GwqzNung@mail.gmail.com
Whole thread Raw
In response to BUG #16183: PREPARED STATEMENT slowed down by jit  (PG Bug reporting form <noreply@postgresql.org>)
Responses Re: BUG #16183: PREPARED STATEMENT slowed down by jit  (Christian Quest <cquest@cquest.org>)
List 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

pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: BUG #16184: Segmentation Fault during update
Next
From: Christian Quest
Date:
Subject: Re: BUG #16183: PREPARED STATEMENT slowed down by jit