Header And Logo

PostgreSQL
| The world's most advanced open source database.

freespace.h

Go to the documentation of this file.
00001 /*-------------------------------------------------------------------------
00002  *
00003  * freespace.h
00004  *    POSTGRES free space map for quickly finding free space in relations
00005  *
00006  *
00007  * Portions Copyright (c) 1996-2013, PostgreSQL Global Development Group
00008  * Portions Copyright (c) 1994, Regents of the University of California
00009  *
00010  * src/include/storage/freespace.h
00011  *
00012  *-------------------------------------------------------------------------
00013  */
00014 #ifndef FREESPACE_H_
00015 #define FREESPACE_H_
00016 
00017 #include "storage/block.h"
00018 #include "storage/relfilenode.h"
00019 #include "utils/relcache.h"
00020 
00021 /* prototypes for public functions in freespace.c */
00022 extern Size GetRecordedFreeSpace(Relation rel, BlockNumber heapBlk);
00023 extern BlockNumber GetPageWithFreeSpace(Relation rel, Size spaceNeeded);
00024 extern BlockNumber RecordAndGetPageWithFreeSpace(Relation rel,
00025                               BlockNumber oldPage,
00026                               Size oldSpaceAvail,
00027                               Size spaceNeeded);
00028 extern void RecordPageWithFreeSpace(Relation rel, BlockNumber heapBlk,
00029                         Size spaceAvail);
00030 extern void XLogRecordPageWithFreeSpace(RelFileNode rnode, BlockNumber heapBlk,
00031                             Size spaceAvail);
00032 
00033 extern void FreeSpaceMapTruncateRel(Relation rel, BlockNumber nblocks);
00034 extern void FreeSpaceMapVacuum(Relation rel);
00035 
00036 #endif   /* FREESPACE_H_ */