pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
marking tuples
3+ messages / 2 participants
[nested] [flat]

* marking tuples
@ 2007-12-04 22:25  Ehab Galal <ehabgalal123@hotmail.com>
  0 siblings, 1 reply; 3+ messages in thread

From: Ehab Galal @ 2007-12-04 22:25 UTC (permalink / raw)
  To: pgsql-sql

Hi,
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:

Consider the following plan:

NewAggregate
    ->NewJoin
          ->NewJoin
                ->NewJoin
                       ->SeqScan

                       ->SeqScan
                ->SeqScan
          ->SeqScan


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.

Any hints about how to keep such mark is greatly appreciated.

Thanks a lot,
Ehab

_________________________________________________________________
You keep typing, we keep giving. Download Messenger and join the i’m Initiative now.
http://im.live.com/messenger/im/home/?source=TAGLM=

^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: marking tuples
@ 2007-12-05 08:44  Gregory Stark <stark@enterprisedb.com>
  parent: Ehab Galal <ehabgalal123@hotmail.com>
  0 siblings, 1 reply; 3+ messages in thread

From: Gregory Stark @ 2007-12-05 08:44 UTC (permalink / raw)
  To: Ehab Galal <ehabgalal123@hotmail.com>; +Cc: pgsql-sql

"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



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: marking tuples
@ 2007-12-05 13:34  Ehab Galal <ehabgalal123@hotmail.com>
  parent: Gregory Stark <stark@enterprisedb.com>
  0 siblings, 0 replies; 3+ messages in thread

From: Ehab Galal @ 2007-12-05 13:34 UTC (permalink / raw)
  To: Gregory Stark <stark@enterprisedb.com>; +Cc: pgsql-sql

Thanks a lot for your reply. I really appreciate it.
I will have only one mark field created for the bottommost NewJoin. The other nodes will just use the same mark field. I just want to make sure that flag propagate up the pipeline.
Thanks again,
ehab


> To: ehabgalal123@hotmail.com
> CC: pgsql-sql@postgresql.org
> Subject: Re: marking tuples
> From: stark@enterprisedb.com
> Date: Wed, 5 Dec 2007 08:44:15 +0000
> 
> "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

_________________________________________________________________
Connect and share in new ways with Windows Live.
http://www.windowslive.com/connect.html?ocid=TXT_TAGLM_Wave2_newways_112007=

^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2007-12-05 13:34 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2007-12-04 22:25 marking tuples Ehab Galal <ehabgalal123@hotmail.com>
2007-12-05 08:44 ` Gregory Stark <stark@enterprisedb.com>
2007-12-05 13:34   ` Ehab Galal <ehabgalal123@hotmail.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox