Skip to content

Commit b032715

Browse files
committed
Remove heap_release_fetch, which is no longer used anywhere; this simplifies
heap_fetch a little.
1 parent d3bf8c7 commit b032715

File tree

2 files changed

+4
-33
lines changed

2 files changed

+4
-33
lines changed

src/backend/access/heap/heapam.c

Lines changed: 3 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $PostgreSQL: pgsql/src/backend/access/heap/heapam.c,v 1.254 2008/03/26 21:10:37 alvherre Exp $
11+
* $PostgreSQL: pgsql/src/backend/access/heap/heapam.c,v 1.255 2008/04/03 17:12:27 tgl Exp $
1212
*
1313
*
1414
* INTERFACE ROUTINES
@@ -1334,30 +1334,6 @@ heap_fetch(Relation relation,
13341334
Buffer *userbuf,
13351335
bool keep_buf,
13361336
Relation stats_relation)
1337-
{
1338-
/* Assume *userbuf is undefined on entry */
1339-
*userbuf = InvalidBuffer;
1340-
return heap_release_fetch(relation, snapshot, tuple,
1341-
userbuf, keep_buf, stats_relation);
1342-
}
1343-
1344-
/*
1345-
* heap_release_fetch - retrieve tuple with given tid
1346-
*
1347-
* This has the same API as heap_fetch except that if *userbuf is not
1348-
* InvalidBuffer on entry, that buffer will be released before reading
1349-
* the new page. This saves a separate ReleaseBuffer step and hence
1350-
* one entry into the bufmgr when looping through multiple fetches.
1351-
* Also, if *userbuf is the same buffer that holds the target tuple,
1352-
* we avoid bufmgr manipulation altogether.
1353-
*/
1354-
bool
1355-
heap_release_fetch(Relation relation,
1356-
Snapshot snapshot,
1357-
HeapTuple tuple,
1358-
Buffer *userbuf,
1359-
bool keep_buf,
1360-
Relation stats_relation)
13611337
{
13621338
ItemPointer tid = &(tuple->t_self);
13631339
ItemId lp;
@@ -1367,11 +1343,9 @@ heap_release_fetch(Relation relation,
13671343
bool valid;
13681344

13691345
/*
1370-
* get the buffer from the relation descriptor. Note that this does a
1371-
* buffer pin, and releases the old *userbuf if not InvalidBuffer.
1346+
* Fetch and pin the appropriate page of the relation.
13721347
*/
1373-
buffer = ReleaseAndReadBuffer(*userbuf, relation,
1374-
ItemPointerGetBlockNumber(tid));
1348+
buffer = ReadBuffer(relation, ItemPointerGetBlockNumber(tid));
13751349

13761350
/*
13771351
* Need share lock on buffer to examine tuple commit status.

src/include/access/heapam.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* Portions Copyright (c) 1996-2008, PostgreSQL Global Development Group
88
* Portions Copyright (c) 1994, Regents of the University of California
99
*
10-
* $PostgreSQL: pgsql/src/include/access/heapam.h,v 1.132 2008/03/26 21:10:39 alvherre Exp $
10+
* $PostgreSQL: pgsql/src/include/access/heapam.h,v 1.133 2008/04/03 17:12:27 tgl Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -153,9 +153,6 @@ extern HeapTuple heap_getnext(HeapScanDesc scan, ScanDirection direction);
153153
extern bool heap_fetch(Relation relation, Snapshot snapshot,
154154
HeapTuple tuple, Buffer *userbuf, bool keep_buf,
155155
Relation stats_relation);
156-
extern bool heap_release_fetch(Relation relation, Snapshot snapshot,
157-
HeapTuple tuple, Buffer *userbuf, bool keep_buf,
158-
Relation stats_relation);
159156
extern bool heap_hot_search_buffer(ItemPointer tid, Buffer buffer,
160157
Snapshot snapshot, bool *all_dead);
161158
extern bool heap_hot_search(ItemPointer tid, Relation relation,

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy