[prev] 20 [next]

Buffer Pool Functions (cont)

Important internal buffer manager function:

BufferDesc *BufferAlloc(
                        Relation r, ForkNumber f,
                        BlockNumber n, bool *found)

  • used by ReadBuffer to find a buffer for (r,f,n)
  • if (r,f,n) already in pool, pin it and return descriptor
  • if no available buffers, select buffer to be replaced
  • returned descriptor is pinned and marked as holding (r,f,n)
  • does not read; ReadBuffer has to do the actual I/O