Postgres 11 gained the ability to perform Just-in-Time Compilation (JIT) based on LLVM technology.
The manual notes that this feature depends on Postgres having been built with the --with-llvm
option.
➥ How can one verify their build of Postgres includes LLVM?
Assuming LLVM is installed… In Postgres 11, JIT is disabled by default. In Postgres 12, the feature is enabled. That raises the question:
➥ How can one tell if JIT is currently enabled or disabled?
Best Answer
Is LLVM built-in?
You can run
pg_config --configure
to see with which flags and options your version was compiled.To quote the documentation:
Is JIT enabled?
To check if JIT is enabled, examine the configuration variable named
jit
.Is JIT available?
Call the system information function
pg_jit_available
to see if JIT can be used in this session. Returnsfalse
ifjit
is set tofalse
.