Header And Logo

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

Functions

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(), 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  page 
)

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

Definition at line 62 of file indexfsm.c.

References RecordPageWithFreeSpace().

Referenced by GetFreeIndexPage().

{
    RecordPageWithFreeSpace(rel, usedBlock, 0);
}