slowjit
A simple demo to illustrate how to implement a JIT provider for PostgreSQL.
slowjit · A simple demo to illustrate how to implement a JIT provider for PostgreSQL.
Overview
Usage
Sources:
- Official upstream README
- Official extension control file (slowjit.control)
- Official implementation source
slowjit is an educational PostgreSQL JIT-provider implementation. It emits C code at runtime, invokes a C compiler, loads the resulting shared library, and currently handles only a small set of expression operators.
Core Workflow
Build and install the provider library, select it through PostgreSQL’s JIT-provider configuration, and force a trivial expression through JIT in an isolated server:
The README uses this query only to demonstrate that one function was JIT-compiled. The module does not install a user-facing SQL API or establish a standalone CREATE EXTENSION workflow.
Important Setting
slowjit.cc_pathselects the C compiler executable; the implementation default iscc.
Requirements and Caveats
- The reviewed control, registry, or catalog evidence identifies version
1.0.0. - The control file marks the extension as relocatable.
- Upstream explicitly calls the provider very inefficient and documents support for only a few operators.
- Runtime compilation executes a server-side compiler and creates loadable code. Restrict filesystem permissions and never treat this prototype as a hardened provider.
- JIT provider interfaces are version-sensitive; build and test it against the exact PostgreSQL server source.