aboutsummaryrefslogtreecommitdiff
path: root/src/backend/executor/nodeTidscan.c
diff options
context:
space:
mode:
authorAndres Freund <andres@anarazel.de>2019-02-26 17:59:01 -0800
committerAndres Freund <andres@anarazel.de>2019-02-26 17:59:01 -0800
commit8aa02b52db11039925191912eca71e3584b68860 (patch)
tree905a1ff148f79b24137f894b35135e24c309c0dc /src/backend/executor/nodeTidscan.c
parentf4b6341d5fcb627d51b3fc89527aa5eaa659fb2e (diff)
downloadpostgresql-8aa02b52db11039925191912eca71e3584b68860.tar.gz
postgresql-8aa02b52db11039925191912eca71e3584b68860.zip
Add ExecStorePinnedBufferHeapTuple.
This allows to avoid an unnecessary pin/unpin cycle when storing a tuple in an already pinned buffer into a slot, when the pin isn't further needed at the call site. Only a single caller for now (to ensure coverage), but upcoming patches will increase use of the new function. Author: Andres Freund Discussion: https://postgr.es/m/20180703070645.wchpu5muyto5n647@alap3.anarazel.de
Diffstat (limited to 'src/backend/executor/nodeTidscan.c')
-rw-r--r--src/backend/executor/nodeTidscan.c17
1 files changed, 5 insertions, 12 deletions
diff --git a/src/backend/executor/nodeTidscan.c b/src/backend/executor/nodeTidscan.c
index 8daf09c785a..9a877874b75 100644
--- a/src/backend/executor/nodeTidscan.c
+++ b/src/backend/executor/nodeTidscan.c
@@ -379,19 +379,12 @@ TidNext(TidScanState *node)
{
/*
* Store the scanned tuple in the scan tuple slot of the scan
- * state. Eventually we will only do this and not return a tuple.
+ * state, transferring the pin to the slot.
*/
- ExecStoreBufferHeapTuple(tuple, /* tuple to store */
- slot, /* slot to store in */
- buffer); /* buffer associated with
- * tuple */
-
- /*
- * At this point we have an extra pin on the buffer, because
- * ExecStoreHeapTuple incremented the pin count. Drop our local
- * pin.
- */
- ReleaseBuffer(buffer);
+ ExecStorePinnedBufferHeapTuple(tuple, /* tuple to store */
+ slot, /* slot to store in */
+ buffer); /* buffer associated with
+ * tuple */
return slot;
}