pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Oleg Bartunov <oleg@sai.msu.su>
To: Gregory Brauer <greg@wildbrain.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: Trees in SQL
Date: Fri, 24 May 2002 23:46:27 +0300 (GMT)
Message-ID: <Pine.GSO.4.44.0205242344070.14692-100000@ra.sai.msu.su> (raw)
In-Reply-To: <3CEE818B.9020702@wildbrain.com>

Check mailing list archive and try
http://www.sai.msu.su/~megera/postgres/gist/tree/
You'd need tree.tar.gz and test data to play with (dmoz catalog)
Unfortunately there is no doc in english :-(
Our approach is extremely fast for searching.

	Oleg

On Fri, 24 May 2002, Gregory Brauer wrote:

>
> I hope this isn't an overly broad topic that ends up diverging into graph
> theory, but I have a tree structure of identical items (analogous to a
> filesystem directory tree) that I need to store in Postgres.  The
> "obvious" design is to give the table that will represent these objects
> a field identifying its "parent" that is a relation to the same table.
> However, this seems to make many common SQL queries rather difficult.
>
> What sort of strategies are best for storing tree structures in a
> relational database, and how would one structure SQL queries to find,
> say, "all of the children anywhere under this node", or to represent
> the condition "if this node is a child at any depth under this other
> node"?  Are there good strategies for preventing cycles?
>
> I'd appreciate any insights anyone can give.
>
> Thanks.
>
> Greg Brauer
> greg@wildbrain.com
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 5: Have you checked our extensive FAQ?
>
> http://www.postgresql.org/users-lounge/docs/faq.html
>

	Regards,
		Oleg
_____________________________________________________________
Oleg Bartunov, sci.researcher, hostmaster of AstroNet,
Sternberg Astronomical Institute, Moscow University (Russia)
Internet: oleg@sai.msu.su, http://www.sai.msu.su/~megera/
phone: +007(095)939-16-83, +007(095)939-23-83




view thread (12+ messages)  latest in thread

Message-ID: <Pine.GSO.4.44.0205242344070.14692-100000@ra.sai.msu.su>
Permalink:  ../Pine.GSO.4.44.0205242344070.14692-100000@ra.sai.msu.su/
Also on:    postgresql.org/message-id/Pine.GSO.4.44.0205242344070.14692-100000@ra.sai.msu.su

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-sql@postgresql.org
  Cc: oleg@sai.msu.su, greg@wildbrain.com
  Subject: Re: Trees in SQL
  In-Reply-To: <Pine.GSO.4.44.0205242344070.14692-100000@ra.sai.msu.su>
  References: <3CEE818B.9020702@wildbrain.com> <Pine.GSO.4.44.0205242344070.14692-100000@ra.sai.msu.su>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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