Re: [PATCHES] Adding fulldisjunctions to the contrib

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Tzahi Fadida <Tzahi(dot)ML(at)gmail(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgreSQL(dot)org>
Subject: Re: [PATCHES] Adding fulldisjunctions to the contrib
Date: 2006-08-11 04:18:49
Message-ID: 200608110418.k7B4In402248@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches


I have looked over this addition, and I think I finally understand it.
Given three tables, A, B, C, which join as A->B, B->C, C->A, you can
really join them as A->B->C, and A->C->B. What full disjunction does is
to perform both of those joins, and return a one row for each join. Here
is an example from the README:

Example of an input and output of a full disjunctions:
INPUT:

--A---|---B---|---C--
X---Y-|-Y---Z-|-X---Z
a-|-b-|-b-|-c-|-a-|-d

A,B and C are relations. X,Y and Z are attributes. a,b,c and d are values.

Note that A,B and C are connected in a cycle. That is:
A is connected to B on attribute Y,
B is connected to C on attribute Z,
C is connected to A on attribute X.

The output of the full disjunctions FD(A,B,C):

FD
X---Y---Z
a-|-b-|-c
a-|-b-|-d

This code is pretty complex, so I can see why it should be in /contrib.
Are there reasonable use cases for this capability?

---------------------------------------------------------------------------

Tzahi Fadida wrote:
> Hi,
> I wish to add the fulldisjunctions function to the contrib.
> With the help of Jonah, we (or rather he :) created a patch with
> regression tests. The function is finished programmatically but
> still a little more code documentation touches and improved error messages
> are needed. All the rest was extensively tested.
>
> Attached is the patch.
>
> Works great. Just compiled from a fresh cvs which i patched with the
> attached diff. ran the fulldijsjunction.sql in the
> share/contrib/fulldisjunction and let it run and it works great.
> 10x.
>
> --
> Regards,
> ????????Tzahi.
> --
> Tzahi Fadida
> Blog: http://tzahi.blogsite.org | Home Site: http://tzahi.webhop.info
> WARNING TO SPAMMERS: ?see at
> http://members.lycos.co.uk/my2nis/spamwarning.html

[ Attachment, skipping... ]

>
> ---------------------------(end of broadcast)---------------------------
> TIP 3: Have you checked our extensive FAQ?
>
> http://www.postgresql.org/docs/faq

--
Bruce Momjian bruce(at)momjian(dot)us
EnterpriseDB http://www.enterprisedb.com

+ If your life is a hard drive, Christ can be your backup. +

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2006-08-11 04:23:26 Re: 8.2 features status
Previous Message Joshua D. Drake 2006-08-11 04:02:36 Re: 8.2 features status

Browse pgsql-patches by date

  From Date Subject
Next Message Michael Glaesemann 2006-08-11 04:35:46 Re: Values list-of-targetlists patch for comments (was Re:
Previous Message Bruce Momjian 2006-08-11 03:48:30 Re: [pstehule@ilikethis.cz: plperl enhancing return