mirror of
https://github.com/postgres/postgres.git
synced 2025-10-27 00:12:01 +03:00
Remove RelationGetBufferWithBuffer(), which is horribly confused about
appropriate pin-count manipulation, and instead use ReleaseAndReadBuffer. Make use of the fact that the passed-in buffer (if there is one) must be pinned to avoid grabbing the bufmgr spinlock when we are able to return this same buffer. Eliminate unnecessary 'previous tuple' and 'next tuple' fields of HeapScanDesc and IndexScanDesc, thereby removing a whole lot of bookkeeping from heap_getnext() and related routines.
This commit is contained in:
@@ -7,17 +7,22 @@
|
||||
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
|
||||
* Portions Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* $Id: buf.h,v 1.8 2001/01/24 19:43:27 momjian Exp $
|
||||
* $Id: buf.h,v 1.9 2001/06/09 18:16:59 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
#ifndef BUF_H
|
||||
#define BUF_H
|
||||
|
||||
#define InvalidBuffer (0)
|
||||
#define UnknownBuffer (-99999)
|
||||
/*
|
||||
* Buffer identifiers.
|
||||
*
|
||||
* Zero is invalid, positive is the index of a shared buffer (1..NBuffers),
|
||||
* negative is the index of a local buffer (-1 .. -NLocBuffer).
|
||||
*/
|
||||
typedef int Buffer;
|
||||
|
||||
typedef long Buffer;
|
||||
#define InvalidBuffer 0
|
||||
|
||||
/*
|
||||
* BufferIsInvalid
|
||||
@@ -25,12 +30,6 @@ typedef long Buffer;
|
||||
*/
|
||||
#define BufferIsInvalid(buffer) ((buffer) == InvalidBuffer)
|
||||
|
||||
/*
|
||||
* BufferIsUnknown
|
||||
* True iff the buffer is unknown.
|
||||
*/
|
||||
#define BufferIsUnknown(buffer) ((buffer) == UnknownBuffer)
|
||||
|
||||
/*
|
||||
* BufferIsLocal
|
||||
* True iff the buffer is local (not visible to other servers).
|
||||
|
||||
Reference in New Issue
Block a user