Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitb032715

Browse files
committed
Remove heap_release_fetch, which is no longer used anywhere; this simplifies
heap_fetch a little.
1 parentd3bf8c7 commitb032715

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
boolkeep_buf,
13361336
Relationstats_relation)
1337-
{
1338-
/* Assume *userbuf is undefined on entry */
1339-
*userbuf=InvalidBuffer;
1340-
returnheap_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(Relationrelation,
1356-
Snapshotsnapshot,
1357-
HeapTupletuple,
1358-
Buffer*userbuf,
1359-
boolkeep_buf,
1360-
Relationstats_relation)
13611337
{
13621338
ItemPointertid=&(tuple->t_self);
13631339
ItemIdlp;
@@ -1367,11 +1343,9 @@ heap_release_fetch(Relation relation,
13671343
boolvalid;
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
externboolheap_fetch(Relationrelation,Snapshotsnapshot,
154154
HeapTupletuple,Buffer*userbuf,boolkeep_buf,
155155
Relationstats_relation);
156-
externboolheap_release_fetch(Relationrelation,Snapshotsnapshot,
157-
HeapTupletuple,Buffer*userbuf,boolkeep_buf,
158-
Relationstats_relation);
159156
externboolheap_hot_search_buffer(ItemPointertid,Bufferbuffer,
160157
Snapshotsnapshot,bool*all_dead);
161158
externboolheap_hot_search(ItemPointertid,Relationrelation,

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp