Introduce the concept of relation forks. An smgr relation can now consist
authorHeikki Linnakangas <heikki@enterprisedb.com>
Mon, 11 Aug 2008 11:05:11 +0000 (11:05 +0000)
committerHeikki Linnakangas <heikki@enterprisedb.com>
Mon, 11 Aug 2008 11:05:11 +0000 (11:05 +0000)
commit208b87c06472bfa1d35c0aa95df93a65a994c093
tree6e017c17515fac58d840392cc6b61bbab9c3964d
parentb0432865de49c9a20e76cf0dbca33df74f378ad5
Introduce the concept of relation forks. An smgr relation can now consist
of multiple forks, and each fork can be created and grown separately.

The bulk of this patch is about changing the smgr API to include an extra
ForkNumber argument in every smgr function. Also, smgrscheduleunlink and
smgrdounlink no longer implicitly call smgrclose, because other forks might
still exist after unlinking one. The callers of those functions have been
modified to call smgrclose instead.

This patch in itself doesn't have any user-visible effect, but provides the
infrastructure needed for upcoming patches. The additional forks envisioned
are a rewritten FSM implementation that doesn't rely on a fixed-size shared
memory block, and a visibility map to allow skipping portions of a table in
VACUUM that have no dead tuples.
31 files changed:
src/backend/access/hash/hashpage.c
src/backend/access/heap/heapam.c
src/backend/access/heap/rewriteheap.c
src/backend/access/nbtree/nbtsort.c
src/backend/access/transam/twophase.c
src/backend/access/transam/xact.c
src/backend/access/transam/xlog.c
src/backend/access/transam/xlogutils.c
src/backend/catalog/catalog.c
src/backend/catalog/heap.c
src/backend/catalog/index.c
src/backend/commands/tablecmds.c
src/backend/postmaster/bgwriter.c
src/backend/rewrite/rewriteDefine.c
src/backend/storage/buffer/bufmgr.c
src/backend/storage/buffer/localbuf.c
src/backend/storage/smgr/README
src/backend/storage/smgr/md.c
src/backend/storage/smgr/smgr.c
src/backend/utils/adt/dbsize.c
src/include/access/heapam.h
src/include/access/htup.h
src/include/access/xact.h
src/include/access/xlog_internal.h
src/include/access/xlogutils.h
src/include/catalog/catalog.h
src/include/postmaster/bgwriter.h
src/include/storage/buf_internals.h
src/include/storage/bufmgr.h
src/include/storage/relfilenode.h
src/include/storage/smgr.h