summaryrefslogtreecommitdiff
path: root/src/backend/access/transam/twophase_rmgr.c
diff options
context:
space:
mode:
authorTom Lane2007-05-27 03:50:39 +0000
committerTom Lane2007-05-27 03:50:39 +0000
commit77947c51c08179b8bc12347a7fbcb2c8d7908302 (patch)
tree0a306ea177817fdadc0e4421b6d8dd212c11e6e3 /src/backend/access/transam/twophase_rmgr.c
parentcadb78330eedceafeda99bf12ac690cda773be62 (diff)
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/access/transam/twophase_rmgr.c')
-rw-r--r--src/backend/access/transam/twophase_rmgr.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/backend/access/transam/twophase_rmgr.c b/src/backend/access/transam/twophase_rmgr.c
index e93bac7b2d8..9c2f14a1a38 100644
--- a/src/backend/access/transam/twophase_rmgr.c
+++ b/src/backend/access/transam/twophase_rmgr.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/access/transam/twophase_rmgr.c,v 1.4 2007/01/05 22:19:23 momjian Exp $
+ * $PostgreSQL: pgsql/src/backend/access/transam/twophase_rmgr.c,v 1.5 2007/05/27 03:50:39 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -16,6 +16,7 @@
#include "access/twophase_rmgr.h"
#include "commands/async.h"
+#include "pgstat.h"
#include "storage/lock.h"
#include "utils/flatfiles.h"
#include "utils/inval.h"
@@ -27,7 +28,8 @@ const TwoPhaseCallback twophase_recover_callbacks[TWOPHASE_RM_MAX_ID + 1] =
lock_twophase_recover, /* Lock */
NULL, /* Inval */
NULL, /* flat file update */
- NULL /* notify/listen */
+ NULL, /* notify/listen */
+ NULL /* pgstat */
};
const TwoPhaseCallback twophase_postcommit_callbacks[TWOPHASE_RM_MAX_ID + 1] =
@@ -36,7 +38,8 @@ const TwoPhaseCallback twophase_postcommit_callbacks[TWOPHASE_RM_MAX_ID + 1] =
lock_twophase_postcommit, /* Lock */
inval_twophase_postcommit, /* Inval */
flatfile_twophase_postcommit, /* flat file update */
- notify_twophase_postcommit /* notify/listen */
+ notify_twophase_postcommit, /* notify/listen */
+ pgstat_twophase_postcommit /* pgstat */
};
const TwoPhaseCallback twophase_postabort_callbacks[TWOPHASE_RM_MAX_ID + 1] =
@@ -45,5 +48,6 @@ const TwoPhaseCallback twophase_postabort_callbacks[TWOPHASE_RM_MAX_ID + 1] =
lock_twophase_postabort, /* Lock */
NULL, /* Inval */
NULL, /* flat file update */
- NULL /* notify/listen */
+ NULL, /* notify/listen */
+ pgstat_twophase_postabort /* pgstat */
};