From ehabgalal123@hotmail.com Tue Dec 4 22:25:18 2007 Received: from localhost (unknown [200.46.204.182]) by postgresql.org (Postfix) with ESMTP id C38E32E00CC for ; Tue, 4 Dec 2007 18:25:18 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.182]) (amavisd-maia, port 10024) with ESMTP id 87043-05 for ; Tue, 4 Dec 2007 18:25:06 -0400 (AST) Received: from bay0-omc2-s16.bay0.hotmail.com (bay0-omc2-s16.bay0.hotmail.com [65.54.246.152]) by postgresql.org (Postfix) with ESMTP id 077A82E011F for ; Tue, 4 Dec 2007 18:25:09 -0400 (AST) Received: from BAY138-W3 ([64.4.49.38]) by bay0-omc2-s16.bay0.hotmail.com with Microsoft SMTPSVC(6.0.3790.3959); Tue, 4 Dec 2007 14:25:09 -0800 Message-ID: Content-Type: multipart/alternative; boundary="_7d956ece-9523-4f92-bf1e-4cd7e7aedd25_" X-Originating-IP: [128.10.9.112] From: Ehab Galal To: "pgsql-sql@postgresql.org" Subject: marking tuples Date: Tue, 4 Dec 2007 17:25:09 -0500 Importance: Normal MIME-Version: 1.0 X-OriginalArrivalTime: 04 Dec 2007 22:25:09.0229 (UTC) FILETIME=[8758C1D0:01C836C4] X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200712/8 X-Sequence-Number: 29700 --_7d956ece-9523-4f92-bf1e-4cd7e7aedd25_ Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable Hi, I am implementing a new algorithm inside postgresql for a side research pro= ject. I am just wondering if anyone may give me few hints about the followi= ng problem: Consider the following plan: NewAggregate ->NewJoin ->NewJoin ->NewJoin ->SeqScan =0A= ->SeqScan ->SeqScan ->SeqScan In my algorithm,=20 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=92m Init= iative now. http://im.live.com/messenger/im/home/?source=3DTAGLM= --_7d956ece-9523-4f92-bf1e-4cd7e7aedd25_ Content-Type: text/html; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable
Hi,
I am impl= ementing a new algorithm inside postgresql for a side research project. I a= m just wondering if anyone may give me few hints about the following proble= m:

Consider the following plan:

NewAggregate
  &= nbsp; ->NewJoin
          ->New= Join
              &nb= sp; ->NewJoin
            &nb= sp;          ->SeqScan
=0A=                  &nb= sp;     ->SeqScan
          &= nbsp;     ->SeqScan
        &= nbsp; ->SeqScan


In my algorithm,
each NewJoin node may "m= ark" 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.

An= y hints about how to keep such mark is greatly appreciated.

Thanks a= lot,
Ehab


You keep typing, we keep giving. Downloa= d Messenger and join the i=92m Initiative now. Join in!<= /body> = --_7d956ece-9523-4f92-bf1e-4cd7e7aedd25_-- From stark@enterprisedb.com Wed Dec 5 08:44:21 2007 Received: from localhost (unknown [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id 59C7B2E0075 for ; Wed, 5 Dec 2007 04:44:21 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 09556-03 for ; Wed, 5 Dec 2007 04:44:05 -0400 (AST) Received: from oxford.xeocode.com (unknown [87.127.95.196]) by postgresql.org (Postfix) with ESMTP id 670E82E0064 for ; Wed, 5 Dec 2007 04:44:17 -0400 (AST) Received: from localhost ([127.0.0.1] helo=oxford.xeocode.com) by oxford.xeocode.com with esmtp (Exim 4.67) (envelope-from ) id 1Izprb-0003qf-N4; Wed, 05 Dec 2007 08:44:15 +0000 To: "Ehab Galal" Cc: Subject: Re: marking tuples In-Reply-To: (Ehab Galal's message of "Tue\, 4 Dec 2007 17\:25\:09 -0500") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1 (gnu/linux) X-Draft-From: ("nnimap+mail01.enterprisedb.com:INBOX.sql" 1440) References: From: Gregory Stark Organization: EnterpriseDB Date: Wed, 05 Dec 2007 08:44:15 +0000 Message-ID: <87odd55y5c.fsf@oxford.xeocode.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200712/11 X-Sequence-Number: 29703 "Ehab Galal" 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 From ehabgalal123@hotmail.com Wed Dec 5 13:34:40 2007 Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id B45AB2E00ED for ; Wed, 5 Dec 2007 09:34:40 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 57522-04 for ; Wed, 5 Dec 2007 09:34:36 -0400 (AST) Received: from bay0-omc1-s14.bay0.hotmail.com (bay0-omc1-s14.bay0.hotmail.com [65.54.246.86]) by postgresql.org (Postfix) with ESMTP id 4B4322E0117 for ; Wed, 5 Dec 2007 09:34:36 -0400 (AST) Received: from BAY138-W30 ([64.4.49.65]) by bay0-omc1-s14.bay0.hotmail.com with Microsoft SMTPSVC(6.0.3790.3959); Wed, 5 Dec 2007 05:34:34 -0800 Message-ID: Content-Type: multipart/alternative; boundary="_5f4fd896-d570-4012-9848-f18675350974_" X-Originating-IP: [128.10.9.112] From: Ehab Galal To: Gregory Stark CC: Subject: Re: marking tuples Date: Wed, 5 Dec 2007 08:34:34 -0500 Importance: Normal In-Reply-To: <87odd55y5c.fsf@oxford.xeocode.com> References: <87odd55y5c.fsf@oxford.xeocode.com> MIME-Version: 1.0 X-OriginalArrivalTime: 05 Dec 2007 13:34:34.0782 (UTC) FILETIME=[92F363E0:01C83743] X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200712/13 X-Sequence-Number: 29705 --_5f4fd896-d570-4012-9848-f18675350974_ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Thanks a lot for your reply. I really appreciate it. I will have only one mark field created for the bottommost NewJoin. The oth= er nodes will just use the same mark field. I just want to make sure that f= lag 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 >=20 > "Ehab Galal" writes: >=20 > > In my algorithm, each NewJoin node may "mark" its ps_ResultTupleSlot wi= th > > either red/green. I need that mark to flow in the pipeline so that i ca= n > > collect them at the top aggregate. >=20 > How will you tell about the marks from different NewJoins? >=20 > 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 oth= er > such flag columns other NewJoin nodes have added. >=20 > 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. >=20 > --=20 > 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=3DTXT_TAGLM_Wave2_newways_1120= 07= --_5f4fd896-d570-4012-9848-f18675350974_ Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Thanks a lot for= your reply. I really appreciate it.
I will have only one mark field cre= ated for the bottommost NewJoin. The other nodes will just use the same mar= k field. I just want to make sure that flag propagate up the pipeline.
<= /div>Thanks again,
ehab



> To: ehab= galal123@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@ho= tmail.com> writes:
>
> > In my algorithm, each NewJoin n= ode 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 mar= ks from different NewJoins?
>
> I think you'll have to "projec= t" 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 set= op code in prepunion.c like intersection to see other
> plans which a= dd 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.<= br>>
> --
> Gregory Stark
> EnterpriseDB = http://www.enterprisedb.com
> Ask me about EnterpriseDB's On-Dema= nd Production Tuning


Connect and share in new ways with Wind= ows Live. Connect now! = --_5f4fd896-d570-4012-9848-f18675350974_--