PostgreSQL Source Code  git master
visibilitymap.h
Go to the documentation of this file.
1 /*-------------------------------------------------------------------------
2  *
3  * visibilitymap.h
4  * visibility map interface
5  *
6  *
7  * Portions Copyright (c) 2007-2021, PostgreSQL Global Development Group
8  * Portions Copyright (c) 1994, Regents of the University of California
9  *
10  * src/include/access/visibilitymap.h
11  *
12  *-------------------------------------------------------------------------
13  */
14 #ifndef VISIBILITYMAP_H
15 #define VISIBILITYMAP_H
16 
18 #include "access/xlogdefs.h"
19 #include "storage/block.h"
20 #include "storage/buf.h"
21 #include "utils/relcache.h"
22 
23 /* Macros for visibilitymap test */
24 #define VM_ALL_VISIBLE(r, b, v) \
25  ((visibilitymap_get_status((r), (b), (v)) & VISIBILITYMAP_ALL_VISIBLE) != 0)
26 #define VM_ALL_FROZEN(r, b, v) \
27  ((visibilitymap_get_status((r), (b), (v)) & VISIBILITYMAP_ALL_FROZEN) != 0)
28 
29 extern bool visibilitymap_clear(Relation rel, BlockNumber heapBlk,
30  Buffer vmbuf, uint8 flags);
31 extern void visibilitymap_pin(Relation rel, BlockNumber heapBlk,
32  Buffer *vmbuf);
33 extern bool visibilitymap_pin_ok(BlockNumber heapBlk, Buffer vmbuf);
34 extern void visibilitymap_set(Relation rel, BlockNumber heapBlk, Buffer heapBuf,
35  XLogRecPtr recptr, Buffer vmBuf, TransactionId cutoff_xid,
36  uint8 flags);
37 extern uint8 visibilitymap_get_status(Relation rel, BlockNumber heapBlk, Buffer *vmbuf);
38 extern void visibilitymap_count(Relation rel, BlockNumber *all_visible, BlockNumber *all_frozen);
40  BlockNumber nheapblocks);
41 
42 #endif /* VISIBILITYMAP_H */
bool visibilitymap_pin_ok(BlockNumber heapBlk, Buffer vmbuf)
uint32 TransactionId
Definition: c.h:587
bool visibilitymap_clear(Relation rel, BlockNumber heapBlk, Buffer vmbuf, uint8 flags)
void visibilitymap_set(Relation rel, BlockNumber heapBlk, Buffer heapBuf, XLogRecPtr recptr, Buffer vmBuf, TransactionId cutoff_xid, uint8 flags)
unsigned char uint8
Definition: c.h:439
uint32 BlockNumber
Definition: block.h:31
BlockNumber visibilitymap_prepare_truncate(Relation rel, BlockNumber nheapblocks)
void visibilitymap_pin(Relation rel, BlockNumber heapBlk, Buffer *vmbuf)
void visibilitymap_count(Relation rel, BlockNumber *all_visible, BlockNumber *all_frozen)
uint64 XLogRecPtr
Definition: xlogdefs.h:21
uint8 visibilitymap_get_status(Relation rel, BlockNumber heapBlk, Buffer *vmbuf)
int Buffer
Definition: buf.h:23