Re: BUG #16183: PREPARED STATEMENT slowed down by jit
Jeff Janes <[email protected]> Thu, 2 Jan 2020 13:00:20 -0500
| Newsgroups | gmane.comp.db.postgresql.bugs |
|---|---|
| Message-ID | <CAMkU=1yApeBH0ajaAPa35sD7t==LY=YmACcXXOGG18GwqzNung@mail.gmail.com> |
> > 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