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

Commitad0bda5

Browse files
committed
Store tuples for EvalPlanQual in slots, rather than as HeapTuples.
For the upcoming pluggable table access methods it's quiteinconvenient to store tuples as HeapTuples, as that'd requireconverting tuples from a their native format into HeapTuples. Insteaduse slots to manage epq tuples.To fit into that scheme, change the foreign data wrapper callbackRefetchForeignRow, to store the tuple in a slot. Insist on using thecaller provided slot, so it conveniently can be stored in thecorresponding EPQ slot. As there is no in core user ofRefetchForeignRow, that change was done blindly, but we plan to testthat soon.To avoid duplicating that work for row locks, move row locks to justdirectly use the EPQ slots - it previously temporarily stored tuplesin LockRowsState.lr_curtuples, but that doesn't seem beneficial, givenwe'd possibly end up with a significant number of additional slots.The behaviour of es_epqTupleSet[rti -1] is now checked byes_epqTupleSlot[rti -1] != NULL, as that is distinguishable from aslot containing an empty tuple.Author: Andres Freund, Haribabu Kommi, Ashutosh BapatDiscussion:https://postgr.es/m/20180703070645.wchpu5muyto5n647@alap3.anarazel.de
1 parent6cbdbd9 commitad0bda5

File tree

13 files changed

+188
-212
lines changed

13 files changed

+188
-212
lines changed

‎doc/src/sgml/fdwhandler.sgml

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -992,29 +992,31 @@ GetForeignRowMarkType(RangeTblEntry *rte,
992992

993993
<para>
994994
<programlisting>
995-
HeapTuple
995+
void
996996
RefetchForeignRow(EState *estate,
997997
ExecRowMark *erm,
998998
Datum rowid,
999+
TupleTableSlot *slot,
9991000
bool *updated);
10001001
</programlisting>
10011002

1002-
Re-fetch one tuple from the foreign table, after locking it if required.
1003+
Re-fetch one tupleslotfrom the foreign table, after locking it if required.
10031004
<literal>estate</literal> is global execution state for the query.
10041005
<literal>erm</literal> is the <structname>ExecRowMark</structname> struct describing
10051006
the target foreign table and the row lock type (if any) to acquire.
10061007
<literal>rowid</literal> identifies the tuple to be fetched.
1007-
<literal>updated</literal> is an output parameter.
1008+
<literal>slot</literal> contains nothing useful upon call, but can be used to
1009+
hold the returned tuple. <literal>updated</literal> is an output parameter.
10081010
</para>
10091011

10101012
<para>
1011-
This function shouldreturn a palloc'ed copy ofthefetched tuple,
1012-
or <literal>NULL</literal> ifthe row lock couldn't be obtained. The row lock
1013-
type to acquire isdefined by <literal>erm-&gt;markType</literal>, which is the
1014-
valuepreviously returned by <function>GetForeignRowMarkType</function>.
1015-
(<literal>ROW_MARK_REFERENCE</literal> means to just re-fetch the tuple without
1016-
acquiring any lock, and <literal>ROW_MARK_COPY</literal> will never be seen by
1017-
this routine.)
1013+
This function shouldstore the tuple intotheprovided, or clear it if if
1014+
the row lock couldn't be obtained. The row lock type to acquire is
1015+
defined by <literal>erm-&gt;markType</literal>, which is the value
1016+
previously returned by <function>GetForeignRowMarkType</function>.
1017+
(<literal>ROW_MARK_REFERENCE</literal> means to just re-fetch the tuple
1018+
withoutacquiring any lock, and <literal>ROW_MARK_COPY</literal> will
1019+
never be seen bythis routine.)
10181020
</para>
10191021

10201022
<para>
@@ -1026,7 +1028,7 @@ RefetchForeignRow(EState *estate,
10261028

10271029
<para>
10281030
Note that by default, failure to acquire a row lock should result in
1029-
raising an error;a <literal>NULL</literal> return is only appropriate if
1031+
raising an error;returning with an empty slot is only appropriate if
10301032
the <literal>SKIP LOCKED</literal> option is specified
10311033
by <literal>erm-&gt;waitPolicy</literal>.
10321034
</para>

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp