diff --git a/src/backend/jit/jit.c b/src/backend/jit/jit.c index fd1cf184c8..b30d0eb0b6 100644 --- a/src/backend/jit/jit.c +++ b/src/backend/jit/jit.c @@ -22,6 +22,7 @@ #include #include "executor/execExpr.h" +#include "executor/executor.h" #include "fmgr.h" #include "jit/jit.h" #include "miscadmin.h" @@ -164,6 +165,10 @@ jit_compile_expr(struct ExprState *state) if (!state->parent) return false; + /* don't do any jit compilation if we're only doing EXPLAIN */ + if ((state->parent->state->es_top_eflags & EXEC_FLAG_EXPLAIN_ONLY)) + return false; + /* if no jitting should be performed at all */ if (!(state->parent->state->es_jit_flags & PGJIT_PERFORM)) return false;