What are ExecSeqMarkPos and ExecSeqRestrPos used for

Started by DTalmost 13 years ago3 messagesgeneral
Jump to latest
#1DT
kurt023@hotmail.com

Hi,

I'm reading code of nodeSeqscan, and was confused with ExecSeqMarkPos and
ExecSeqRestrPos. They are only called by ExecMergeJoin. Could merge join use
a plain seqscan as outer/inner plan? If not, what are they used for?

Thanks.

#2Stephen Frost
sfrost@snowman.net
In reply to: DT (#1)
Re: What are ExecSeqMarkPos and ExecSeqRestrPos used for

* DT (kurt023@hotmail.com) wrote:

I'm reading code of nodeSeqscan, and was confused with ExecSeqMarkPos and
ExecSeqRestrPos. They are only called by ExecMergeJoin. Could merge join use
a plain seqscan as outer/inner plan? If not, what are they used for?

ExecSeqMarkPos and ExecSeqRestPos are called through execAmi.c's
generalized ExecMarkPos and ExecRestrPos, which are then used by both
nodeMergejoin.c and nodeResult.c. Offhand, it seems unlikely that there
would ever be a path from MergeJoin down to ExecSeqMarkPos as MergeJoin
requires sorted inputs. Perhaps it could happen with a full cartesian
product but I don't know that we'd ever use a MergeJoin to implement
that or that we have such an optimization today.

Thanks,

Stephen

#3Tom Lane
tgl@sss.pgh.pa.us
In reply to: Stephen Frost (#2)
Re: What are ExecSeqMarkPos and ExecSeqRestrPos used for

Stephen Frost <sfrost@snowman.net> writes:

* DT (kurt023@hotmail.com) wrote:

I'm reading code of nodeSeqscan, and was confused with ExecSeqMarkPos and
ExecSeqRestrPos. They are only called by ExecMergeJoin. Could merge join use
a plain seqscan as outer/inner plan? If not, what are they used for?

ExecSeqMarkPos and ExecSeqRestPos are called through execAmi.c's
generalized ExecMarkPos and ExecRestrPos, which are then used by both
nodeMergejoin.c and nodeResult.c. Offhand, it seems unlikely that there
would ever be a path from MergeJoin down to ExecSeqMarkPos as MergeJoin
requires sorted inputs. Perhaps it could happen with a full cartesian
product but I don't know that we'd ever use a MergeJoin to implement
that or that we have such an optimization today.

I'm pretty sure those are dead code. See the comment for
ExecSupportsMarkRestore.

regards, tom lane

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general