Re: Query JITing with LLVM ORC - Mailing list pgsql-hackers

From Thomas Munro
Subject Re: Query JITing with LLVM ORC
Date
Msg-id CA+hUKGKkGkyM2p2r70rvFdy5KCPfAWBgXu1xL_3gwKv4KGV-SQ@mail.gmail.com
Whole thread Raw
In response to Query JITing with LLVM ORC  (João Paulo Labegalini de Carvalho <jaopaulolc@gmail.com>)
Responses Re: Query JITing with LLVM ORC
List pgsql-hackers
On Thu, Sep 22, 2022 at 4:17 AM João Paulo Labegalini de Carvalho
<jaopaulolc@gmail.com> wrote:
> I am working on a project with LLVM ORC that led us to PostgreSQL as a target application. We were surprised by
learningthat PGSQL already uses LLVM ORC to JIT certain queries. 

It JITs expressions but not whole queries.  Query execution at the
tuple-flow level is still done using a C call stack the same shape as
the query plan, but it *could* be transformed to a different control
flow that could be run more efficiently and perhaps JITed.  CCing
Andres who developed all this and had some ideas about that...

> I would love to know what motivated this feature and for what it is being currently used for,

https://www.postgresql.org/docs/current/jit-reason.html

> as it is not enabled by default.

It's enabled by default in v12 and higher (if you built with
--with-llvm, as packagers do), but not always used:

https://www.postgresql.org/docs/current/jit-decision.html



pgsql-hackers by date:

Previous
From: Justin Pryzby
Date:
Subject: Re: [RFC] building postgres with meson - v13
Next
From: Nathan Bossart
Date:
Subject: Re: Reducing the WAL overhead of freezing in VACUUM by deduplicating per-tuple freeze plans