8
8
*
9
9
*
10
10
* 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 $
12
12
*
13
13
*
14
14
* INTERFACE ROUTINES
@@ -1334,30 +1334,6 @@ heap_fetch(Relation relation,
1334
1334
Buffer * userbuf ,
1335
1335
bool keep_buf ,
1336
1336
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 )
1361
1337
{
1362
1338
ItemPointer tid = & (tuple -> t_self );
1363
1339
ItemId lp ;
@@ -1367,11 +1343,9 @@ heap_release_fetch(Relation relation,
1367
1343
bool valid ;
1368
1344
1369
1345
/*
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.
1372
1347
*/
1373
- buffer = ReleaseAndReadBuffer (* userbuf , relation ,
1374
- ItemPointerGetBlockNumber (tid ));
1348
+ buffer = ReadBuffer (relation , ItemPointerGetBlockNumber (tid ));
1375
1349
1376
1350
/*
1377
1351
* Need share lock on buffer to examine tuple commit status.
0 commit comments