visibilitymap.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. /*-------------------------------------------------------------------------
  2. *
  3. * visibilitymap.h
  4. * visibility map interface
  5. *
  6. *
  7. * Portions Copyright (c) 2007-2022, 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. #include "access/visibilitymapdefs.h"
  17. #include "access/xlogdefs.h"
  18. #include "storage/block.h"
  19. #include "storage/buf.h"
  20. #include "utils/relcache.h"
  21. /* Macros for visibilitymap test */
  22. #define VM_ALL_VISIBLE(r, b, v) \
  23. ((visibilitymap_get_status((r), (b), (v)) & VISIBILITYMAP_ALL_VISIBLE) != 0)
  24. #define VM_ALL_FROZEN(r, b, v) \
  25. ((visibilitymap_get_status((r), (b), (v)) & VISIBILITYMAP_ALL_FROZEN) != 0)
  26. extern bool visibilitymap_clear(Relation rel, BlockNumber heapBlk,
  27. Buffer vmbuf, uint8 flags);
  28. extern void visibilitymap_pin(Relation rel, BlockNumber heapBlk,
  29. Buffer *vmbuf);
  30. extern bool visibilitymap_pin_ok(BlockNumber heapBlk, Buffer vmbuf);
  31. extern void visibilitymap_set(Relation rel, BlockNumber heapBlk, Buffer heapBuf,
  32. XLogRecPtr recptr, Buffer vmBuf, TransactionId cutoff_xid,
  33. uint8 flags);
  34. extern uint8 visibilitymap_get_status(Relation rel, BlockNumber heapBlk, Buffer *vmbuf);
  35. extern void visibilitymap_count(Relation rel, BlockNumber *all_visible, BlockNumber *all_frozen);
  36. extern BlockNumber visibilitymap_prepare_truncate(Relation rel,
  37. BlockNumber nheapblocks);
  38. #endif /* VISIBILITYMAP_H */