Remove heap_release_fetch, which is no longer used anywhere; this simplifies
authorTom Lane <tgl@sss.pgh.pa.us>
Thu, 3 Apr 2008 17:12:27 +0000 (17:12 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Thu, 3 Apr 2008 17:12:27 +0000 (17:12 +0000)
heap_fetch a little.

src/backend/access/heap/heapam.c
src/include/access/heapam.h

index c208350da195fe6136d74d7bb2127c2d411efa58..cf19dab45187877ce73abe8b47dd4198da4122ca 100644 (file)
@@ -1334,30 +1334,6 @@ heap_fetch(Relation relation,
                   Buffer *userbuf,
                   bool keep_buf,
                   Relation stats_relation)
-{
-       /* Assume *userbuf is undefined on entry */
-       *userbuf = InvalidBuffer;
-       return heap_release_fetch(relation, snapshot, tuple,
-                                                         userbuf, keep_buf, stats_relation);
-}
-
-/*
- *     heap_release_fetch              - retrieve tuple with given tid
- *
- * This has the same API as heap_fetch except that if *userbuf is not
- * InvalidBuffer on entry, that buffer will be released before reading
- * the new page.  This saves a separate ReleaseBuffer step and hence
- * one entry into the bufmgr when looping through multiple fetches.
- * Also, if *userbuf is the same buffer that holds the target tuple,
- * we avoid bufmgr manipulation altogether.
- */
-bool
-heap_release_fetch(Relation relation,
-                                  Snapshot snapshot,
-                                  HeapTuple tuple,
-                                  Buffer *userbuf,
-                                  bool keep_buf,
-                                  Relation stats_relation)
 {
        ItemPointer tid = &(tuple->t_self);
        ItemId          lp;
@@ -1367,11 +1343,9 @@ heap_release_fetch(Relation relation,
        bool            valid;
 
        /*
-        * get the buffer from the relation descriptor. Note that this does a
-        * buffer pin, and releases the old *userbuf if not InvalidBuffer.
+        * Fetch and pin the appropriate page of the relation.
         */
-       buffer = ReleaseAndReadBuffer(*userbuf, relation,
-                                                                 ItemPointerGetBlockNumber(tid));
+       buffer = ReadBuffer(relation, ItemPointerGetBlockNumber(tid));
 
        /*
         * Need share lock on buffer to examine tuple commit status.
index ed6cd2f6369afd2572861853112225bba0a9636d..d0f41d264f98992593ed96f399b7ab175fc30aac 100644 (file)
@@ -153,9 +153,6 @@ extern HeapTuple heap_getnext(HeapScanDesc scan, ScanDirection direction);
 extern bool heap_fetch(Relation relation, Snapshot snapshot,
                   HeapTuple tuple, Buffer *userbuf, bool keep_buf,
                   Relation stats_relation);
-extern bool heap_release_fetch(Relation relation, Snapshot snapshot,
-                                  HeapTuple tuple, Buffer *userbuf, bool keep_buf,
-                                  Relation stats_relation);
 extern bool heap_hot_search_buffer(ItemPointer tid, Buffer buffer,
                                           Snapshot snapshot, bool *all_dead);
 extern bool heap_hot_search(ItemPointer tid, Relation relation,