Re: DAGs and recursive queries

From: Oleg Bartunov <oleg(at)sai(dot)msu(dot)su>
To: "paul(dot)dorman" <paul(dot)dorman(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: DAGs and recursive queries
Date: 2007-09-26 19:41:44
Message-ID: Pine.LNX.4.64.0709262341220.2767@sn.sai.msu.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

take a look on contrib/ltree

On Wed, 26 Sep 2007, paul.dorman wrote:

> Hi everyone,
>
> I would like to know the best way to implement a DAG in PostgreSQL. I
> understand there has been some talk of recursive queries, and I'm
> wondering if there has been much progress on this.
>
> Are there any complete examples of DAGs which work with PostgreSQL? I
> would like to be able to do the following operations for a
> categorization system:
>
> 1. Given a node, get one or more field values out of every parent node
> 2. Given a parent node, get one or more field values out of every
> child node
> 3. Given two or more parent nodes, identify any common children.
>
> I do not need to determine shortest paths between parents and
> children, only to be able to iterate over them as efficiently as
> possible.
>
> I'd like to keep things dynamic so changes up the hierarchy don't
> require changes to any of the children (unless their direct parents
> are changed). I'd also like to keep as much processing as possible in
> the database to minimize the traffic between my application and the
> DB, so I think I'm looking for SQL and stored procedure solutions.
>
> Any pointers would be great, as I'm not a DBA and do not have the
> experience to make judgments about the best possible approach.
>
> Regards,
> Paul Dorman
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 3: Have you checked our extensive FAQ?
>
> http://www.postgresql.org/docs/faq
>

Regards,
Oleg
_____________________________________________________________
Oleg Bartunov, Research Scientist, Head of AstroNet (www.astronet.ru)
Sternberg Astronomical Institute, Moscow University, Russia
Internet: oleg(at)sai(dot)msu(dot)su, http://www.sai.msu.su/~megera/
phone: +007(495)939-16-83, +007(495)939-23-83

In response to

Browse pgsql-general by date

  From Date Subject
Next Message John Smith 2007-09-26 19:51:07 decode access privileges
Previous Message Scott Marlowe 2007-09-26 19:18:21 Re: Help tuning a large table off disk and into RAM