PostgreSQL Source Code  git master
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.


BlockNumber GetFreeIndexPage (Relation rel)
void RecordFreeIndexPage (Relation rel, BlockNumber freeBlock)
void RecordUsedIndexPage (Relation rel, BlockNumber usedBlock)
void IndexFreeSpaceMapVacuum (Relation rel)

Function Documentation

◆ GetFreeIndexPage()

BlockNumber GetFreeIndexPage ( Relation  rel)

Definition at line 38 of file indexfsm.c.

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

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

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

◆ IndexFreeSpaceMapVacuum()

void IndexFreeSpaceMapVacuum ( Relation  rel)

Definition at line 71 of file indexfsm.c.

72 {
73  FreeSpaceMapVacuum(rel);
74 }
void FreeSpaceMapVacuum(Relation rel)
Definition: freespace.c:335

References FreeSpaceMapVacuum().

Referenced by blvacuumcleanup(), btvacuumscan(), ginInsertCleanup(), ginvacuumcleanup(), gistvacuumscan(), and spgvacuumscan().

◆ RecordFreeIndexPage()

void RecordFreeIndexPage ( Relation  rel,
BlockNumber  freeBlock 

Definition at line 52 of file indexfsm.c.

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

References RecordPageWithFreeSpace().

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

◆ RecordUsedIndexPage()

void RecordUsedIndexPage ( Relation  rel,
BlockNumber  usedBlock 

Definition at line 62 of file indexfsm.c.

63 {
64  RecordPageWithFreeSpace(rel, usedBlock, 0);
65 }

References RecordPageWithFreeSpace().

Referenced by GetFreeIndexPage().