aboutsummaryrefslogtreecommitdiff
path: root/src/backend/executor/nodeBitmapHeapscan.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2007-06-09 18:49:55 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2007-06-09 18:49:55 +0000
commit85d72f05167b87bc44464b2eabea8538f1fd1e45 (patch)
treefc7af5457fa0611971618803ffa6f47396d3a183 /src/backend/executor/nodeBitmapHeapscan.c
parent7063c46fc18e2987b655b0bc7531128633daac7e (diff)
downloadpostgresql-85d72f05167b87bc44464b2eabea8538f1fd1e45.tar.gz
postgresql-85d72f05167b87bc44464b2eabea8538f1fd1e45.zip
Teach heapam code to know the difference between a real seqscan and the
pseudo HeapScanDesc created for a bitmap heap scan. This avoids some useless overhead during a bitmap scan startup, in particular invoking the syncscan code. (We might someday want to do that, but right now it's merely useless contention for shared memory, to say nothing of possibly pushing useful entries out of syncscan's small LRU list.) This also allows elimination of ugly pgstat_discount_heap_scan() kluge.
Diffstat (limited to 'src/backend/executor/nodeBitmapHeapscan.c')
-rw-r--r--src/backend/executor/nodeBitmapHeapscan.c23
1 files changed, 6 insertions, 17 deletions
diff --git a/src/backend/executor/nodeBitmapHeapscan.c b/src/backend/executor/nodeBitmapHeapscan.c
index 07729da2be6..c2ae755e014 100644
--- a/src/backend/executor/nodeBitmapHeapscan.c
+++ b/src/backend/executor/nodeBitmapHeapscan.c
@@ -21,7 +21,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/executor/nodeBitmapHeapscan.c,v 1.17 2007/05/27 03:50:39 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/executor/nodeBitmapHeapscan.c,v 1.18 2007/06/09 18:49:55 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -388,9 +388,6 @@ ExecBitmapHeapReScan(BitmapHeapScanState *node, ExprContext *exprCtxt)
/* rescan to release any page pin */
heap_rescan(node->ss.ss_currentScanDesc, NULL);
- /* undo bogus "seq scan" count (see notes in ExecInitBitmapHeapScan) */
- pgstat_discount_heap_scan(node->ss.ss_currentScanDesc->rs_rd);
-
if (node->tbm)
tbm_free(node->tbm);
node->tbm = NULL;
@@ -522,20 +519,12 @@ ExecInitBitmapHeapScan(BitmapHeapScan *node, EState *estate, int eflags)
/*
* Even though we aren't going to do a conventional seqscan, it is useful
- * to create a HeapScanDesc --- this checks the relation size and sets up
- * statistical infrastructure for us.
- */
- scanstate->ss.ss_currentScanDesc = heap_beginscan(currentRelation,
- estate->es_snapshot,
- 0,
- NULL);
-
- /*
- * One problem is that heap_beginscan counts a "sequential scan" start,
- * when we actually aren't doing any such thing. Reverse out the added
- * scan count. (Eventually we may want to count bitmap scans separately.)
+ * to create a HeapScanDesc --- most of the fields in it are usable.
*/
- pgstat_discount_heap_scan(scanstate->ss.ss_currentScanDesc->rs_rd);
+ scanstate->ss.ss_currentScanDesc = heap_beginscan_bm(currentRelation,
+ estate->es_snapshot,
+ 0,
+ NULL);
/*
* get the scan type from the relation descriptor.