diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2007-05-27 03:50:39 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2007-05-27 03:50:39 +0000 |
commit | 77947c51c08179b8bc12347a7fbcb2c8d7908302 (patch) | |
tree | 0a306ea177817fdadc0e4421b6d8dd212c11e6e3 /src/backend/executor/nodeBitmapHeapscan.c | |
parent | cadb78330eedceafeda99bf12ac690cda773be62 (diff) | |
download | postgresql-77947c51c08179b8bc12347a7fbcb2c8d7908302.tar.gz postgresql-77947c51c08179b8bc12347a7fbcb2c8d7908302.zip |
Fix up pgstats counting of live and dead tuples to recognize that committed
and aborted transactions have different effects; also teach it not to assume
that prepared transactions are always committed.
Along the way, simplify the pgstats API by tying counting directly to
Relations; I cannot detect any redeeming social value in having stats
pointers in HeapScanDesc and IndexScanDesc structures. And fix a few
corner cases in which counts might be missed because the relation's
pgstat_info pointer hadn't been set.
Diffstat (limited to 'src/backend/executor/nodeBitmapHeapscan.c')
-rw-r--r-- | src/backend/executor/nodeBitmapHeapscan.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/backend/executor/nodeBitmapHeapscan.c b/src/backend/executor/nodeBitmapHeapscan.c index 3e9a91de2f5..07729da2be6 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.16 2007/01/05 22:19:28 momjian Exp $ + * $PostgreSQL: pgsql/src/backend/executor/nodeBitmapHeapscan.c,v 1.17 2007/05/27 03:50:39 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -189,7 +189,7 @@ BitmapHeapNext(BitmapHeapScanState *node) scan->rs_ctup.t_len = ItemIdGetLength(lp); ItemPointerSet(&scan->rs_ctup.t_self, tbmres->blockno, targoffset); - pgstat_count_heap_fetch(&scan->rs_pgstat_info); + pgstat_count_heap_fetch(scan->rs_rd); /* * Set up the result slot to point to this tuple. Note that the slot @@ -389,7 +389,7 @@ ExecBitmapHeapReScan(BitmapHeapScanState *node, ExprContext *exprCtxt) 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_pgstat_info); + pgstat_discount_heap_scan(node->ss.ss_currentScanDesc->rs_rd); if (node->tbm) tbm_free(node->tbm); @@ -535,7 +535,7 @@ ExecInitBitmapHeapScan(BitmapHeapScan *node, EState *estate, int eflags) * when we actually aren't doing any such thing. Reverse out the added * scan count. (Eventually we may want to count bitmap scans separately.) */ - pgstat_discount_heap_scan(&scanstate->ss.ss_currentScanDesc->rs_pgstat_info); + pgstat_discount_heap_scan(scanstate->ss.ss_currentScanDesc->rs_rd); /* * get the scan type from the relation descriptor. |