mirror of
https://github.com/postgres/postgres.git
synced 2025-11-04 20:11:56 +03:00
Introduce visibility map. The visibility map is a bitmap with one bit per
heap page, where a set bit indicates that all tuples on the page are visible to all transactions, and the page therefore doesn't need vacuuming. It is stored in a new relation fork. Lazy vacuum uses the visibility map to skip pages that don't need vacuuming. Vacuum is also responsible for setting the bits in the map. In the future, this can hopefully be used to implement index-only-scans, but we can't currently guarantee that the visibility map is always 100% up-to-date. In addition to the visibility map, there's a new PD_ALL_VISIBLE flag on each heap page, also indicating that all tuples on the page are visible to all transactions. It's important that this flag is kept up-to-date. It is also used to skip visibility tests in sequential scans, which gives a small performance gain on seqscans.
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
* Portions Copyright (c) 1996-2008, PostgreSQL Global Development Group
|
||||
* Portions Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* $PostgreSQL: pgsql/src/include/utils/rel.h,v 1.109 2008/11/26 17:08:58 heikki Exp $
|
||||
* $PostgreSQL: pgsql/src/include/utils/rel.h,v 1.110 2008/12/03 13:05:22 heikki Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -195,8 +195,12 @@ typedef struct RelationData
|
||||
List *rd_indpred; /* index predicate tree, if any */
|
||||
void *rd_amcache; /* available for use by index AM */
|
||||
|
||||
/* size of the FSM, or InvalidBlockNumber if not known yet */
|
||||
/*
|
||||
* sizes of the free space and visibility map forks, or InvalidBlockNumber
|
||||
* if not known yet
|
||||
*/
|
||||
BlockNumber rd_fsm_nblocks;
|
||||
BlockNumber rd_vm_nblocks;
|
||||
|
||||
/* use "struct" here to avoid needing to include pgstat.h: */
|
||||
struct PgStat_TableStatus *pgstat_info; /* statistics collection area */
|
||||
|
||||
Reference in New Issue
Block a user