PostgreSQL Source Code  git master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
indexfsm.h File Reference
#include "storage/block.h"
#include "utils/relcache.h"
Include dependency graph for indexfsm.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

BlockNumber GetFreeIndexPage (Relation rel)
 
void RecordFreeIndexPage (Relation rel, BlockNumber page)
 
void RecordUsedIndexPage (Relation rel, BlockNumber page)
 
void IndexFreeSpaceMapVacuum (Relation rel)
 

Function Documentation

BlockNumber GetFreeIndexPage ( Relation  rel)

Definition at line 38 of file indexfsm.c.

References GetPageWithFreeSpace(), InvalidBlockNumber, and RecordUsedIndexPage().

Referenced by _bt_getbuf(), BloomNewBuffer(), GinNewBuffer(), gistNewBuffer(), and SpGistNewBuffer().

39 {
40  BlockNumber blkno = GetPageWithFreeSpace(rel, BLCKSZ / 2);
41 
42  if (blkno != InvalidBlockNumber)
43  RecordUsedIndexPage(rel, blkno);
44 
45  return blkno;
46 }
uint32 BlockNumber
Definition: block.h:31
#define InvalidBlockNumber
Definition: block.h:33
void RecordUsedIndexPage(Relation rel, BlockNumber usedBlock)
Definition: indexfsm.c:62
BlockNumber GetPageWithFreeSpace(Relation rel, Size spaceNeeded)
Definition: freespace.c:132
void IndexFreeSpaceMapVacuum ( Relation  rel)

Definition at line 71 of file indexfsm.c.

References FreeSpaceMapVacuum().

Referenced by blvacuumcleanup(), btvacuumcleanup(), ginInsertCleanup(), ginvacuumcleanup(), gistvacuumcleanup(), and spgvacuumcleanup().

72 {
73  FreeSpaceMapVacuum(rel);
74 }
void FreeSpaceMapVacuum(Relation rel)
Definition: freespace.c:379
void RecordFreeIndexPage ( Relation  rel,
BlockNumber  page 
)

Definition at line 52 of file indexfsm.c.

References RecordPageWithFreeSpace().

Referenced by blvacuumcleanup(), btvacuumpage(), ginvacuumcleanup(), gistvacuumcleanup(), shiftList(), and spgvacuumpage().

53 {
54  RecordPageWithFreeSpace(rel, freeBlock, BLCKSZ - 1);
55 }
void RecordPageWithFreeSpace(Relation rel, BlockNumber heapBlk, Size spaceAvail)
Definition: freespace.c:181
void RecordUsedIndexPage ( Relation  rel,
BlockNumber  page 
)

Definition at line 62 of file indexfsm.c.

References RecordPageWithFreeSpace().

Referenced by GetFreeIndexPage().

63 {
64  RecordPageWithFreeSpace(rel, usedBlock, 0);
65 }
void RecordPageWithFreeSpace(Relation rel, BlockNumber heapBlk, Size spaceAvail)
Definition: freespace.c:181