mirror of
https://github.com/postgres/postgres.git
synced 2025-11-04 20:11:56 +03:00
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.
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
* Portions Copyright (c) 1996-2007, PostgreSQL Global Development Group
|
||||
* Portions Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* $PostgreSQL: pgsql/src/include/utils/rel.h,v 1.100 2007/03/29 00:15:39 tgl Exp $
|
||||
* $PostgreSQL: pgsql/src/include/utils/rel.h,v 1.101 2007/05/27 03:50:39 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -89,15 +89,6 @@ typedef struct TriggerDesc
|
||||
} TriggerDesc;
|
||||
|
||||
|
||||
/*
|
||||
* Same for the statistics collector data in Relation and scan data.
|
||||
*/
|
||||
typedef struct PgStat_Info
|
||||
{
|
||||
void *tabentry;
|
||||
} PgStat_Info;
|
||||
|
||||
|
||||
/*
|
||||
* Cached lookup information for the index access method functions defined
|
||||
* by the pg_am row associated with an index relation.
|
||||
@@ -200,8 +191,8 @@ typedef struct RelationData
|
||||
List *rd_indpred; /* index predicate tree, if any */
|
||||
void *rd_amcache; /* available for use by index AM */
|
||||
|
||||
/* statistics collection area */
|
||||
PgStat_Info pgstat_info;
|
||||
/* use "struct" here to avoid needing to include pgstat.h: */
|
||||
struct PgStat_TableStatus *pgstat_info; /* statistics collection area */
|
||||
} RelationData;
|
||||
|
||||
typedef RelationData *Relation;
|
||||
|
||||
Reference in New Issue
Block a user