PostgreSQL Source Code  git master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
indexfsm.c File Reference
#include "postgres.h"
#include "storage/freespace.h"
#include "storage/indexfsm.h"
Include dependency graph for indexfsm.c:

Go to the source code of this file.

Functions

BlockNumber GetFreeIndexPage (Relation rel)
 
void RecordFreeIndexPage (Relation rel, BlockNumber freeBlock)
 
void RecordUsedIndexPage (Relation rel, BlockNumber usedBlock)
 
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  freeBlock 
)

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  usedBlock 
)

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