Header And Logo

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

Functions

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(), GinNewBuffer(), gistNewBuffer(), and SpGistNewBuffer().

{
    BlockNumber blkno = GetPageWithFreeSpace(rel, BLCKSZ / 2);

    if (blkno != InvalidBlockNumber)
        RecordUsedIndexPage(rel, blkno);

    return blkno;
}

void IndexFreeSpaceMapVacuum ( Relation  rel  ) 
void RecordFreeIndexPage ( Relation  rel,
BlockNumber  freeBlock 
)

Definition at line 52 of file indexfsm.c.

References RecordPageWithFreeSpace().

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

{
    RecordPageWithFreeSpace(rel, freeBlock, BLCKSZ - 1);
}

void RecordUsedIndexPage ( Relation  rel,
BlockNumber  usedBlock 
)

Definition at line 62 of file indexfsm.c.

References RecordPageWithFreeSpace().

Referenced by GetFreeIndexPage().

{
    RecordPageWithFreeSpace(rel, usedBlock, 0);
}