aboutsummaryrefslogtreecommitdiff
path: root/src/backend/access/gist/gistbuild.c
diff options
context:
space:
mode:
authorKevin Grittner <kgrittn@postgresql.org>2016-04-20 08:31:19 -0500
committerKevin Grittner <kgrittn@postgresql.org>2016-04-20 08:31:19 -0500
commita343e223a5c33a7283a6d8b255c9dbc48dbc5061 (patch)
treef02f3de305180170d8d5e51120861ae6770b31e8 /src/backend/access/gist/gistbuild.c
parent4db0d2d2fe935e086dfd26c00f707dab298b443c (diff)
downloadpostgresql-a343e223a5c33a7283a6d8b255c9dbc48dbc5061.tar.gz
postgresql-a343e223a5c33a7283a6d8b255c9dbc48dbc5061.zip
Revert no-op changes to BufferGetPage()
The reverted changes were intended to force a choice of whether any newly-added BufferGetPage() calls needed to be accompanied by a test of the snapshot age, to support the "snapshot too old" feature. Such an accompanying test is needed in about 7% of the cases, where the page is being used as part of a scan rather than positioning for other purposes (such as DML or vacuuming). The additional effort required for back-patching, and the doubt whether the intended benefit would really be there, have indicated it is best just to rely on developers to do the right thing based on comments and existing usage, as we do with many other conventions. This change should have little or no effect on generated executable code. Motivated by the back-patching pain of Tom Lane and Robert Haas
Diffstat (limited to 'src/backend/access/gist/gistbuild.c')
-rw-r--r--src/backend/access/gist/gistbuild.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/src/backend/access/gist/gistbuild.c b/src/backend/access/gist/gistbuild.c
index 8e7389c05f3..4e43a6932a4 100644
--- a/src/backend/access/gist/gistbuild.c
+++ b/src/backend/access/gist/gistbuild.c
@@ -169,7 +169,7 @@ gistbuild(Relation heap, Relation index, IndexInfo *indexInfo)
/* initialize the root page */
buffer = gistNewBuffer(index);
Assert(BufferGetBlockNumber(buffer) == GIST_ROOT_BLKNO);
- page = BufferGetPage(buffer, NULL, NULL, BGP_NO_SNAPSHOT_TEST);
+ page = BufferGetPage(buffer);
START_CRIT_SECTION();
@@ -589,7 +589,7 @@ gistProcessItup(GISTBuildState *buildstate, IndexTuple itup,
buffer = ReadBuffer(indexrel, blkno);
LockBuffer(buffer, GIST_EXCLUSIVE);
- page = BufferGetPage(buffer, NULL, NULL, BGP_NO_SNAPSHOT_TEST);
+ page = (Page) BufferGetPage(buffer);
childoffnum = gistchoose(indexrel, page, itup, giststate);
iid = PageGetItemId(page, childoffnum);
idxtuple = (IndexTuple) PageGetItem(page, iid);
@@ -699,8 +699,7 @@ gistbufferinginserttuples(GISTBuildState *buildstate, Buffer buffer, int level,
*/
if (is_split && BufferGetBlockNumber(buffer) == GIST_ROOT_BLKNO)
{
- Page page = BufferGetPage(buffer, NULL, NULL,
- BGP_NO_SNAPSHOT_TEST);
+ Page page = BufferGetPage(buffer);
OffsetNumber off;
OffsetNumber maxoff;
@@ -867,7 +866,7 @@ gistBufferingFindCorrectParent(GISTBuildState *buildstate,
}
buffer = ReadBuffer(buildstate->indexrel, parent);
- page = BufferGetPage(buffer, NULL, NULL, BGP_NO_SNAPSHOT_TEST);
+ page = BufferGetPage(buffer);
LockBuffer(buffer, GIST_EXCLUSIVE);
gistcheckpage(buildstate->indexrel, buffer);
maxoff = PageGetMaxOffsetNumber(page);
@@ -1068,7 +1067,7 @@ gistGetMaxLevel(Relation index)
* pro forma.
*/
LockBuffer(buffer, GIST_SHARE);
- page = BufferGetPage(buffer, NULL, NULL, BGP_NO_SNAPSHOT_TEST);
+ page = (Page) BufferGetPage(buffer);
if (GistPageIsLeaf(page))
{
@@ -1168,8 +1167,7 @@ gistMemorizeAllDownlinks(GISTBuildState *buildstate, Buffer parentbuf)
OffsetNumber maxoff;
OffsetNumber off;
BlockNumber parentblkno = BufferGetBlockNumber(parentbuf);
- Page page = BufferGetPage(parentbuf, NULL, NULL,
- BGP_NO_SNAPSHOT_TEST);
+ Page page = BufferGetPage(parentbuf);
Assert(!GistPageIsLeaf(page));