1/*-------------------------------------------------------------------------
4 * POSTGRES free space map for quickly finding free pages in relations
7 * Portions Copyright (c) 1996-2025, PostgreSQL Global Development Group
8 * Portions Copyright (c) 1994, Regents of the University of California
11 * src/backend/storage/freespace/indexfsm.c
16 * This is similar to the FSM used for heap, in freespace.c, but instead
17 * of tracking the amount of free space on pages, we only track whether
18 * pages are completely free or in-use. We use the same FSM implementation
19 * as for heaps, using 0 to denote used pages, and (BLCKSZ - 1) for unused.
21 *-------------------------------------------------------------------------
33 * GetFreeIndexPage - return a free page from the FSM
35 * As a side effect, the page is marked as used in the FSM.
49 * RecordFreeIndexPage - mark a page as free in the FSM
59 * RecordUsedIndexPage - mark a page as used in the FSM
68 * IndexFreeSpaceMapVacuum - scan and fix any inconsistencies in the FSM
#define InvalidBlockNumber
void FreeSpaceMapVacuum(Relation rel)
void RecordPageWithFreeSpace(Relation rel, BlockNumber heapBlk, Size spaceAvail)
BlockNumber GetPageWithFreeSpace(Relation rel, Size spaceNeeded)
void RecordUsedIndexPage(Relation rel, BlockNumber usedBlock)
BlockNumber GetFreeIndexPage(Relation rel)
void IndexFreeSpaceMapVacuum(Relation rel)
void RecordFreeIndexPage(Relation rel, BlockNumber freeBlock)