]> granicus.if.org Git - postgresql/blobdiff - src/backend/executor/nodeBitmapIndexscan.c
Make some small planner API cleanups.
[postgresql] / src / backend / executor / nodeBitmapIndexscan.c
index 6feb70f4ae3ed7293675ae56fbcc3f185fa0aeb1..bd837d3cd8e13c5a146461e6553afc02697faf21 100644 (file)
@@ -3,7 +3,7 @@
  * nodeBitmapIndexscan.c
  *       Routines to support bitmapped index scans of relations
  *
- * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2019, PostgreSQL Global Development Group
  * Portions Copyright (c) 1994, Regents of the University of California
  *
  *
@@ -21,6 +21,7 @@
  */
 #include "postgres.h"
 
+#include "access/genam.h"
 #include "executor/execdebug.h"
 #include "executor/nodeBitmapIndexscan.h"
 #include "executor/nodeIndexscan.h"
@@ -226,6 +227,15 @@ ExecInitBitmapIndexScan(BitmapIndexScan *node, EState *estate, int eflags)
        /* normally we don't make the result bitmap till runtime */
        indexstate->biss_result = NULL;
 
+       /*
+        * We do not open or lock the base relation here.  We assume that an
+        * ancestor BitmapHeapScan node is holding AccessShareLock (or better) on
+        * the heap relation throughout the execution of the plan tree.
+        */
+
+       indexstate->ss.ss_currentRelation = NULL;
+       indexstate->ss.ss_currentScanDesc = NULL;
+
        /*
         * Miscellaneous initialization
         *
@@ -242,15 +252,6 @@ ExecInitBitmapIndexScan(BitmapIndexScan *node, EState *estate, int eflags)
         * sub-parts corresponding to runtime keys (see below).
         */
 
-       /*
-        * We do not open or lock the base relation here.  We assume that an
-        * ancestor BitmapHeapScan node is holding AccessShareLock (or better) on
-        * the heap relation throughout the execution of the plan tree.
-        */
-
-       indexstate->ss.ss_currentRelation = NULL;
-       indexstate->ss.ss_currentScanDesc = NULL;
-
        /*
         * If we are just doing EXPLAIN (ie, aren't going to run the plan), stop
         * here.  This allows an index-advisor plugin to EXPLAIN a plan containing