diff options
author | Heikki Linnakangas <heikki.linnakangas@iki.fi> | 2008-12-03 13:05:22 +0000 |
---|---|---|
committer | Heikki Linnakangas <heikki.linnakangas@iki.fi> | 2008-12-03 13:05:22 +0000 |
commit | 608195a3a3656145a7eec7a47d903bc684011d73 (patch) | |
tree | b6e425e9de5d44d8c4725b4c04824c5ad252401d /src/backend/access/transam/xlogutils.c | |
parent | 44ff90966cd05d7371e559c35e5f2a3979868c64 (diff) | |
download | postgresql-608195a3a3656145a7eec7a47d903bc684011d73.tar.gz postgresql-608195a3a3656145a7eec7a47d903bc684011d73.zip |
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.
Diffstat (limited to 'src/backend/access/transam/xlogutils.c')
-rw-r--r-- | src/backend/access/transam/xlogutils.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/backend/access/transam/xlogutils.c b/src/backend/access/transam/xlogutils.c index 466cc648581..6a2588de189 100644 --- a/src/backend/access/transam/xlogutils.c +++ b/src/backend/access/transam/xlogutils.c @@ -11,7 +11,7 @@ * Portions Copyright (c) 1996-2008, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/backend/access/transam/xlogutils.c,v 1.64 2008/11/26 17:08:57 heikki Exp $ + * $PostgreSQL: pgsql/src/backend/access/transam/xlogutils.c,v 1.65 2008/12/03 13:05:22 heikki Exp $ * *------------------------------------------------------------------------- */ @@ -377,6 +377,7 @@ CreateFakeRelcacheEntry(RelFileNode rnode) rel->rd_targblock = InvalidBlockNumber; rel->rd_fsm_nblocks = InvalidBlockNumber; + rel->rd_vm_nblocks = InvalidBlockNumber; rel->rd_smgr = NULL; return rel; |