Introduce the concept of relation forks. An smgr relation can now consist

Heikki Linnakangas <heikki.linnakangas@iki.fi>

Commit: 3f0e808c4a487b1c12546acd80e6140d5093227b
Author: Heikki Linnakangas <heikki.linnakangas@iki.fi>
Date: 2008-08-11T11:05:11Z
Releases: 8.4.0
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.

Files

PathChange+/−
src/backend/access/hash/hashpage.c modified +4 −4
src/backend/access/heap/heapam.c modified +6 −4
src/backend/access/heap/rewriteheap.c modified +6 −4
src/backend/access/nbtree/nbtsort.c modified +9 −6
src/backend/access/transam/twophase.c modified +31 −23
src/backend/access/transam/xact.c modified +29 −15
src/backend/access/transam/xlog.c modified +4 −4
src/backend/access/transam/xlogutils.c modified +37 −22
src/backend/catalog/catalog.c modified +26 −13
src/backend/catalog/heap.c modified +13 −5
src/backend/catalog/index.c modified +28 −12
src/backend/commands/tablecmds.c modified +40 −32
src/backend/postmaster/bgwriter.c modified +4 −3
src/backend/rewrite/rewriteDefine.c modified +8 −2
src/backend/storage/buffer/bufmgr.c modified +64 −40
src/backend/storage/buffer/localbuf.c modified +8 −4
src/backend/storage/smgr/md.c modified +178 −121
src/backend/storage/smgr/README modified +18 −1
src/backend/storage/smgr/smgr.c modified +107 −69
src/backend/utils/adt/dbsize.c modified +3 −2
src/include/access/heapam.h modified +3 −2
src/include/access/htup.h modified +2 −1
src/include/access/xact.h modified +7 −7
src/include/access/xlog_internal.h modified +2 −1
src/include/access/xlogutils.h modified +6 −3
src/include/catalog/catalog.h modified +2 −2
src/include/postmaster/bgwriter.h modified +3 −2
src/include/storage/buf_internals.h modified +10 −6
src/include/storage/bufmgr.h modified +9 −6
src/include/storage/relfilenode.h modified +28 −2
src/include/storage/smgr.h modified +38 −28