summaryrefslogtreecommitdiff
path: root/src/backend/executor/nodeValuesscan.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/executor/nodeValuesscan.c')
-rw-r--r--src/backend/executor/nodeValuesscan.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/backend/executor/nodeValuesscan.c b/src/backend/executor/nodeValuesscan.c
index 63b7e7ef5b8..6ec087b9688 100644
--- a/src/backend/executor/nodeValuesscan.c
+++ b/src/backend/executor/nodeValuesscan.c
@@ -25,6 +25,7 @@
#include "executor/executor.h"
#include "executor/nodeValuesscan.h"
+#include "jit/jit.h"
#include "utils/expandeddatum.h"
@@ -98,6 +99,7 @@ ValuesNext(ValuesScanState *node)
bool *isnull;
ListCell *lc;
int resind;
+ int saved_jit_flags;
/*
* Get rid of any prior cycle's leftovers. We use ReScanExprContext
@@ -128,7 +130,15 @@ ValuesNext(ValuesScanState *node)
oldsubplans = node->ss.ps.subPlan;
node->ss.ps.subPlan = NIL;
+ /*
+ * As the expressions are only ever used once, disable JIT for
+ * them. This is worthwhile because it's common to insert significant
+ * amounts of data via VALUES().
+ */
+ saved_jit_flags = econtext->ecxt_estate->es_jit_flags;
+ econtext->ecxt_estate->es_jit_flags = PGJIT_NONE;
exprstatelist = ExecInitExprList(exprlist, &node->ss.ps);
+ econtext->ecxt_estate->es_jit_flags = saved_jit_flags;
node->ss.ps.subPlan = oldsubplans;