PostgreSQL Source Code
git master
|
#include "access/visibilitymapdefs.h"
#include "access/xlogdefs.h"
#include "storage/block.h"
#include "storage/buf.h"
#include "utils/relcache.h"
Go to the source code of this file.
Macros | |
#define | VM_ALL_VISIBLE(r, b, v) ((visibilitymap_get_status((r), (b), (v)) & VISIBILITYMAP_ALL_VISIBLE) != 0) |
#define | VM_ALL_FROZEN(r, b, v) ((visibilitymap_get_status((r), (b), (v)) & VISIBILITYMAP_ALL_FROZEN) != 0) |
Functions | |
bool | visibilitymap_clear (Relation rel, BlockNumber heapBlk, Buffer vmbuf, uint8 flags) |
void | visibilitymap_pin (Relation rel, BlockNumber heapBlk, Buffer *vmbuf) |
bool | visibilitymap_pin_ok (BlockNumber heapBlk, Buffer vmbuf) |
void | visibilitymap_set (Relation rel, BlockNumber heapBlk, Buffer heapBuf, XLogRecPtr recptr, Buffer vmBuf, TransactionId cutoff_xid, uint8 flags) |
uint8 | visibilitymap_get_status (Relation rel, BlockNumber heapBlk, Buffer *vmbuf) |
void | visibilitymap_count (Relation rel, BlockNumber *all_visible, BlockNumber *all_frozen) |
BlockNumber | visibilitymap_prepare_truncate (Relation rel, BlockNumber nheapblocks) |
#define VM_ALL_FROZEN | ( | r, | |
b, | |||
v | |||
) | ((visibilitymap_get_status((r), (b), (v)) & VISIBILITYMAP_ALL_FROZEN) != 0) |
Definition at line 26 of file visibilitymap.h.
#define VM_ALL_VISIBLE | ( | r, | |
b, | |||
v | |||
) | ((visibilitymap_get_status((r), (b), (v)) & VISIBILITYMAP_ALL_VISIBLE) != 0) |
Definition at line 24 of file visibilitymap.h.
bool visibilitymap_clear | ( | Relation | rel, |
BlockNumber | heapBlk, | ||
Buffer | vmbuf, | ||
uint8 | flags | ||
) |
Definition at line 138 of file visibilitymap.c.
References Assert, BUFFER_LOCK_EXCLUSIVE, BUFFER_LOCK_UNLOCK, BufferGetBlockNumber(), BufferGetPage(), BufferIsValid(), DEBUG1, elog, ERROR, HEAPBLK_TO_MAPBLOCK, HEAPBLK_TO_MAPBYTE, HEAPBLK_TO_OFFSET, LockBuffer(), MarkBufferDirty(), PageGetContents(), RelationGetRelationName, VISIBILITYMAP_ALL_VISIBLE, and VISIBILITYMAP_VALID_BITS.
Referenced by heap_delete(), heap_force_common(), heap_insert(), heap_lock_tuple(), heap_lock_updated_tuple_rec(), heap_multi_insert(), heap_update(), heap_xlog_delete(), heap_xlog_insert(), heap_xlog_lock(), heap_xlog_lock_updated(), heap_xlog_multi_insert(), heap_xlog_update(), and lazy_scan_prune().
void visibilitymap_count | ( | Relation | rel, |
BlockNumber * | all_visible, | ||
BlockNumber * | all_frozen | ||
) |
Definition at line 384 of file visibilitymap.c.
References Assert, BufferGetPage(), BufferIsValid(), FROZEN_MASK8, MAPSIZE, PageGetContents(), pg_popcount_masked(), ReleaseBuffer(), VISIBLE_MASK8, and vm_readbuf().
Referenced by do_analyze_rel(), heap_vacuum_rel(), and index_update_stats().
uint8 visibilitymap_get_status | ( | Relation | rel, |
BlockNumber | heapBlk, | ||
Buffer * | vmbuf | ||
) |
Definition at line 336 of file visibilitymap.c.
References BufferGetBlockNumber(), BufferGetPage(), BufferIsValid(), DEBUG1, elog, HEAPBLK_TO_MAPBLOCK, HEAPBLK_TO_MAPBYTE, HEAPBLK_TO_OFFSET, InvalidBuffer, PageGetContents(), RelationGetRelationName, ReleaseBuffer(), VISIBILITYMAP_VALID_BITS, and vm_readbuf().
Referenced by collect_visibility_data(), find_next_unskippable_block(), lazy_scan_prune(), pg_visibility(), pg_visibility_map(), pg_visibility_map_summary(), and verify_heapam().
void visibilitymap_pin | ( | Relation | rel, |
BlockNumber | heapBlk, | ||
Buffer * | vmbuf | ||
) |
Definition at line 191 of file visibilitymap.c.
References BufferGetBlockNumber(), BufferIsValid(), HEAPBLK_TO_MAPBLOCK, ReleaseBuffer(), and vm_readbuf().
Referenced by GetVisibilityMapPins(), heap_delete(), heap_force_common(), heap_lock_tuple(), heap_lock_updated_tuple_rec(), heap_update(), heap_xlog_delete(), heap_xlog_insert(), heap_xlog_lock(), heap_xlog_lock_updated(), heap_xlog_multi_insert(), heap_xlog_update(), heap_xlog_visible(), lazy_scan_heap(), lazy_vacuum_heap_rel(), and RelationGetBufferForTuple().
bool visibilitymap_pin_ok | ( | BlockNumber | heapBlk, |
Buffer | vmbuf | ||
) |
Definition at line 215 of file visibilitymap.c.
References BufferGetBlockNumber(), BufferIsValid(), and HEAPBLK_TO_MAPBLOCK.
Referenced by GetVisibilityMapPins(), heap_multi_insert(), and RelationGetBufferForTuple().
BlockNumber visibilitymap_prepare_truncate | ( | Relation | rel, |
BlockNumber | nheapblocks | ||
) |
Definition at line 438 of file visibilitymap.c.
References BUFFER_LOCK_EXCLUSIVE, BufferGetPage(), BufferIsValid(), DEBUG1, elog, END_CRIT_SECTION, HEAPBLK_TO_MAPBLOCK, HEAPBLK_TO_MAPBYTE, HEAPBLK_TO_OFFSET, InRecovery, InvalidBlockNumber, LockBuffer(), log_newpage_buffer(), MAPSIZE, MarkBufferDirty(), MemSet, PageGetContents(), RelationGetRelationName, RelationGetSmgr(), RelationNeedsWAL, smgrexists(), smgrnblocks(), START_CRIT_SECTION, UnlockReleaseBuffer(), VISIBILITYMAP_FORKNUM, vm_readbuf(), and XLogHintBitIsNeeded.
Referenced by pg_truncate_visibility_map(), RelationTruncate(), and smgr_redo().
void visibilitymap_set | ( | Relation | rel, |
BlockNumber | heapBlk, | ||
Buffer | heapBuf, | ||
XLogRecPtr | recptr, | ||
Buffer | vmBuf, | ||
TransactionId | cutoff_xid, | ||
uint8 | flags | ||
) |
Definition at line 244 of file visibilitymap.c.
References Assert, BUFFER_LOCK_EXCLUSIVE, BUFFER_LOCK_UNLOCK, BufferGetBlockNumber(), BufferGetPage(), BufferIsValid(), DEBUG1, elog, END_CRIT_SECTION, ERROR, HEAPBLK_TO_MAPBLOCK, HEAPBLK_TO_MAPBYTE, HEAPBLK_TO_OFFSET, InRecovery, LockBuffer(), log_heap_visible(), MarkBufferDirty(), PageGetContents(), PageIsAllVisible(), PageSetLSN(), RelationGetRelationName, RelationNeedsWAL, START_CRIT_SECTION, VISIBILITYMAP_ALL_FROZEN, VISIBILITYMAP_VALID_BITS, XLogHintBitIsNeeded, and XLogRecPtrIsInvalid.
Referenced by heap_multi_insert(), heap_xlog_visible(), lazy_scan_new_or_empty(), lazy_scan_prune(), and lazy_vacuum_heap_page().