Обсуждение: marking tuples

Поиск
Список
Период
Сортировка

marking tuples

От
Ehab Galal
Дата:
<div style="text-align: left;">Hi,<br />I am implementing a new algorithm inside postgresql for a side research
project.I am just wondering if anyone may give me few hints about the following problem:<br /><br />Consider the
followingplan:<br /><br />NewAggregate<br />    ->NewJoin<br />          ->NewJoin<br />               
->NewJoin<br/>                       ->SeqScan<br />                        ->SeqScan<br />               
->SeqScan<br/>          ->SeqScan<br /><br /><br />In my algorithm, <br />each NewJoin node may "mark" its
ps_ResultTupleSlotwith either red/green. I need that mark to flow in the pipeline so that i can collect them at the top
aggregate.<br/><br />Any hints about how to keep such mark is greatly appreciated.<br /><br />Thanks a lot,<br
/>Ehab<br/></div><br /><hr />You keep typing, we keep giving. Download Messenger and join the i’m Initiative now. <a
href="http://im.live.com/messenger/im/home/?source=CRM_WL_joinnow"target="_new">Join in!</a> 

Re: marking tuples

От
Gregory Stark
Дата:
"Ehab Galal" <ehabgalal123@hotmail.com> writes:

> In my algorithm, each NewJoin node may "mark" its ps_ResultTupleSlot with
> either red/green. I need that mark to flow in the pipeline so that i can
> collect them at the top aggregate.

How will you tell about the marks from different NewJoins?

I think you'll have to "project" the tuple and add a resjunk column to
indicate that flag. I don't know how you'll identify that column from other
such flag columns other NewJoin nodes have added.

You could look at the setop code in prepunion.c like intersection to see other
plans which add flag columns. In those cases though they are used by the
direct parent of the node which added it, so the planner can just mark a field
in the parent indicating which column it should look at for the flag.

--  Gregory Stark EnterpriseDB          http://www.enterprisedb.com Ask me about EnterpriseDB's On-Demand Production
Tuning


Re: marking tuples

От
Ehab Galal
Дата:
<div style="text-align: left;">Thanks a lot for your reply. I really appreciate it.<br />I will have only one mark
fieldcreated for the bottommost NewJoin. The other nodes will just use the same mark field. I just want to make sure
thatflag propagate up the pipeline.<br /></div>Thanks again,<br />ehab<br /><br /><br /><hr id="stopSpelling" />>
To:ehabgalal123@hotmail.com<br />> CC: pgsql-sql@postgresql.org<br />> Subject: Re: marking tuples<br />>
From:stark@enterprisedb.com<br />> Date: Wed, 5 Dec 2007 08:44:15 +0000<br />> <br />> "Ehab Galal"
<ehabgalal123@hotmail.com>writes:<br />> <br />> > In my algorithm, each NewJoin node may "mark" its
ps_ResultTupleSlotwith<br />> > either red/green. I need that mark to flow in the pipeline so that i can<br
/>>> collect them at the top aggregate.<br />> <br />> How will you tell about the marks from different
NewJoins?<br/>> <br />> I think you'll have to "project" the tuple and add a resjunk column to<br />> indicate
thatflag. I don't know how you'll identify that column from other<br />> such flag columns other NewJoin nodes have
added.<br/>> <br />> You could look at the setop code in prepunion.c like intersection to see other<br />>
planswhich add flag columns. In those cases though they are used by the<br />> direct parent of the node which added
it,so the planner can just mark a field<br />> in the parent indicating which column it should look at for the
flag.<br/>> <br />> -- <br />> Gregory Stark<br />> EnterpriseDB http://www.enterprisedb.com<br />> Ask
meabout EnterpriseDB's On-Demand Production Tuning<br /><br /><hr />Connect and share in new ways with Windows Live. <a
href="http://www.windowslive.com/connect.html?ocid=TXT_TAGLM_Wave2_newways_112007"target="_new">Connect now!</a>