Introduce the concept of relation forks. An smgr relation can now consist
commit9ee50ef1b62b55153162b86d11892db4ae95e47d
authorheikki <heikki>
Mon, 11 Aug 2008 11:05:11 +0000 (11 11:05 +0000)
committerheikki <heikki>
Mon, 11 Aug 2008 11:05:11 +0000 (11 11:05 +0000)
tree74301d6029547847bec7ec4bf4af950853b6ebd0
parentb147ccd420f0adfd526e681beffccfd370bacfad
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