PostgreSQL Source Code
git master
|
#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 | BITS_PER_HEAPBLOCK 2 |
#define | VISIBILITYMAP_ALL_VISIBLE 0x01 |
#define | VISIBILITYMAP_ALL_FROZEN 0x02 |
#define | VISIBILITYMAP_VALID_BITS |
#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) |
void | visibilitymap_truncate (Relation rel, BlockNumber nheapblocks) |
#define BITS_PER_HEAPBLOCK 2 |
Definition at line 23 of file visibilitymap.h.
Referenced by rewriteVisibilityMap().
#define VISIBILITYMAP_ALL_FROZEN 0x02 |
Definition at line 27 of file visibilitymap.h.
Referenced by collect_visibility_data(), heap_lock_tuple(), heap_lock_updated_tuple_rec(), heap_update(), heap_xlog_lock(), heap_xlog_lock_updated(), lazy_scan_heap(), lazy_vacuum_page(), pg_visibility(), pg_visibility_map(), and pg_visibility_map_summary().
#define VISIBILITYMAP_ALL_VISIBLE 0x01 |
Definition at line 26 of file visibilitymap.h.
Referenced by collect_visibility_data(), lazy_scan_heap(), lazy_vacuum_page(), pg_visibility(), pg_visibility_map(), pg_visibility_map_summary(), and rewriteVisibilityMap().
#define VISIBILITYMAP_VALID_BITS |
Definition at line 28 of file visibilitymap.h.
Referenced by heap_delete(), heap_insert(), heap_multi_insert(), heap_update(), heap_xlog_delete(), heap_xlog_insert(), heap_xlog_multi_insert(), heap_xlog_update(), lazy_scan_heap(), visibilitymap_clear(), visibilitymap_get_status(), and visibilitymap_set().
#define VM_ALL_FROZEN | ( | r, | |
b, | |||
v | |||
) | ((visibilitymap_get_status((r), (b), (v)) & VISIBILITYMAP_ALL_FROZEN) != 0) |
Definition at line 34 of file visibilitymap.h.
Referenced by collect_corrupt_items(), and lazy_scan_heap().
#define VM_ALL_VISIBLE | ( | r, | |
b, | |||
v | |||
) | ((visibilitymap_get_status((r), (b), (v)) & VISIBILITYMAP_ALL_VISIBLE) != 0) |
Definition at line 32 of file visibilitymap.h.
Referenced by BitmapHeapNext(), BitmapPrefetch(), collect_corrupt_items(), IndexOnlyNext(), lazy_scan_heap(), and statapprox_heap().
bool visibilitymap_clear | ( | Relation | rel, |
BlockNumber | heapBlk, | ||
Buffer | vmbuf, | ||
uint8 | flags | ||
) |
Definition at line 169 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, and VISIBILITYMAP_VALID_BITS.
Referenced by heap_delete(), 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_heap().
void visibilitymap_count | ( | Relation | rel, |
BlockNumber * | all_visible, | ||
BlockNumber * | all_frozen | ||
) |
Definition at line 408 of file visibilitymap.c.
References Assert, BufferGetPage, BufferIsValid, i, MAPSIZE, number_of_ones_for_frozen, number_of_ones_for_visible, PageGetContents, ReleaseBuffer(), and vm_readbuf().
Referenced by do_analyze_rel(), index_update_stats(), and lazy_vacuum_rel().
uint8 visibilitymap_get_status | ( | Relation | rel, |
BlockNumber | heapBlk, | ||
Buffer * | vmbuf | ||
) |
Definition at line 360 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(), lazy_scan_heap(), lazy_vacuum_page(), pg_visibility(), pg_visibility_map(), and pg_visibility_map_summary().
void visibilitymap_pin | ( | Relation | rel, |
BlockNumber | heapBlk, | ||
Buffer * | vmbuf | ||
) |
Definition at line 220 of file visibilitymap.c.
References BufferGetBlockNumber(), BufferIsValid, HEAPBLK_TO_MAPBLOCK, ReleaseBuffer(), and vm_readbuf().
Referenced by GetVisibilityMapPins(), heap_delete(), 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(), and RelationGetBufferForTuple().
bool visibilitymap_pin_ok | ( | BlockNumber | heapBlk, |
Buffer | vmbuf | ||
) |
Definition at line 244 of file visibilitymap.c.
References BufferGetBlockNumber(), BufferIsValid, and HEAPBLK_TO_MAPBLOCK.
Referenced by GetVisibilityMapPins().
void visibilitymap_set | ( | Relation | rel, |
BlockNumber | heapBlk, | ||
Buffer | heapBuf, | ||
XLogRecPtr | recptr, | ||
Buffer | vmBuf, | ||
TransactionId | cutoff_xid, | ||
uint8 | flags | ||
) |
Definition at line 273 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, RelationData::rd_node, RelationGetRelationName, RelationNeedsWAL, START_CRIT_SECTION, VISIBILITYMAP_VALID_BITS, XLogHintBitIsNeeded, and XLogRecPtrIsInvalid.
Referenced by heap_xlog_visible(), lazy_scan_heap(), and lazy_vacuum_page().
void visibilitymap_truncate | ( | Relation | rel, |
BlockNumber | nheapblocks | ||
) |
Definition at line 462 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, LockBuffer(), log_newpage_buffer(), MAPSIZE, MarkBufferDirty(), MemSet, PageGetContents, RelationData::rd_smgr, RelationGetRelationName, RelationNeedsWAL, RelationOpenSmgr, SMgrRelationData::smgr_vm_nblocks, smgrexists(), smgrnblocks(), smgrtruncate(), START_CRIT_SECTION, UnlockReleaseBuffer(), VISIBILITYMAP_FORKNUM, vm_readbuf(), and XLogHintBitIsNeeded.
Referenced by pg_truncate_visibility_map(), RelationTruncate(), and smgr_redo().