[prev] 16 [next]

Buffer Pool Data Types

typedef struct buftag {
   RelFileNode rnode;     /* physical relation identifier */
   ForkNumber  forkNum;
   BlockNumber blockNum;  /* relative to start of reln */
} BufferTag;

BufFlags: BM_DIRTY, BM_VALID, BM_TAG_VALID, BM_IO_IN_PROGRESS, ...
typedef struct sbufdesc { (simplified)
   BufferTag tag;         /* ID of page contained in buffer */
   BufFlags  flags;       /* see bit definitions above */
   uint16    usage_count; /* usage counter for clock sweep */
   unsigned  refcount;    /* # of backends holding pins */
   int       buf_id;      /* buffer's index number (from 0) */
   int       freeNext;    /* link in freelist chain */
   ...
} BufferDesc;