summaryrefslogtreecommitdiff
path: root/src/include/storage/relfilenode.h
diff options
context:
space:
mode:
authorHeikki Linnakangas2008-12-03 13:05:22 +0000
committerHeikki Linnakangas2008-12-03 13:05:22 +0000
commit608195a3a3656145a7eec7a47d903bc684011d73 (patch)
treeb6e425e9de5d44d8c4725b4c04824c5ad252401d /src/include/storage/relfilenode.h
parent44ff90966cd05d7371e559c35e5f2a3979868c64 (diff)
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/include/storage/relfilenode.h')
-rw-r--r--src/include/storage/relfilenode.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/include/storage/relfilenode.h b/src/include/storage/relfilenode.h
index adedad61b33..90a0f642d40 100644
--- a/src/include/storage/relfilenode.h
+++ b/src/include/storage/relfilenode.h
@@ -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/storage/relfilenode.h,v 1.20 2008/11/19 10:34:52 heikki Exp $
+ * $PostgreSQL: pgsql/src/include/storage/relfilenode.h,v 1.21 2008/12/03 13:05:22 heikki Exp $
*
*-------------------------------------------------------------------------
*/
@@ -24,14 +24,15 @@ typedef enum ForkNumber
{
InvalidForkNumber = -1,
MAIN_FORKNUM = 0,
- FSM_FORKNUM
+ FSM_FORKNUM,
+ VISIBILITYMAP_FORKNUM
/*
* NOTE: if you add a new fork, change MAX_FORKNUM below and update the
* forkNames array in catalog.c
*/
} ForkNumber;
-#define MAX_FORKNUM FSM_FORKNUM
+#define MAX_FORKNUM VISIBILITYMAP_FORKNUM
/*
* RelFileNode must provide all that we need to know to physically access