WIP: Disable JITing for VALUES() nodes.
authorAndres Freund <andres@anarazel.de>
Wed, 24 Jan 2018 07:20:02 +0000 (23:20 -0800)
committerAndres Freund <andres@anarazel.de>
Wed, 21 Mar 2018 02:34:25 +0000 (19:34 -0700)
VALUES() nodes are only ever executed once. This is primarily helpful
for debugging, when forcing JITing even for cheap queries.

Author: Andres Freund
Discussion: https://postgr.es/m/20170901064131.tazjxwus3k2w3ybh@alap3.anarazel.de

src/backend/executor/nodeValuesscan.c

index 63b7e7ef5b82bbf30b0ed6b08fda47f396b006ee..722c46081e9d9e9e73f21b3eb78436bffb3c5ec9 100644 (file)
@@ -98,6 +98,7 @@ ValuesNext(ValuesScanState *node)
        bool       *isnull;
        ListCell   *lc;
        int         resind;
+       int         jitstate;
 
        /*
         * Get rid of any prior cycle's leftovers.  We use ReScanExprContext
@@ -128,7 +129,10 @@ ValuesNext(ValuesScanState *node)
        oldsubplans = node->ss.ps.subPlan;
        node->ss.ps.subPlan = NIL;
 
+       jitstate = econtext->ecxt_estate->es_jit_flags;
+       econtext->ecxt_estate->es_jit_flags = 0;
        exprstatelist = ExecInitExprList(exprlist, &node->ss.ps);
+       econtext->ecxt_estate->es_jit_flags = jitstate;
 
        node->ss.ps.subPlan = oldsubplans;