From: Oleg Bartunov <oleg@sai.msu.su>
To: Christian Rishoej <chrris@mail.dk>
Cc: Christopher Kings-Lynne <chriskl@familyhealth.com.au>
Cc: pgsql-sql@postgresql.org
Subject: Re: Optimizing the implementation of an optimized tree
Date: Tue, 7 May 2002 14:54:01 +0300 (GMT)
Message-ID: <Pine.GSO.4.44.0205071443490.12738-100000@ra.sai.msu.su> (raw)
In-Reply-To: <1020769399.889.10.camel@penelope.dyndns.dk>
On 7 May 2002, Christian Rishoej wrote:
> On Tue, 2002-05-07 at 04:00, Christopher Kings-Lynne wrote:
>
> > Why not try Oleg and Teodor's tree module?
> >
> > http://cddb.sai.msu.su/~megera/postgres/gist/
> >
> > You have to expend a little effort in implementing it as the README's in
> > Russian :) Still has examples tho.
>
> As far as I can tell Oleg and Teotor are doing *balanced* trees, and not
> trees usable for containing a hiearchy of nodes where each node can have
> 0-N children.
>
> It is my understanding that I cannot rely on the organization of a
> balanced tree - hence the name "balanced" (nodes are inserted where some
> algotithm thinks it fits in, not where I want it. Imagine if your
> directory-hiearchy on your filesystem was a balanced tree...).
Hmm, you decide where to insert new node. It's my fault we don't have
english documentation for our module. But it was designed to work with
catalog like structure. Here is the link to my original posting:
http://fts.postgresql.org/db/mw/msg.html?mid=1352122
Test data (snapshot DMOZ) is available from
http://www.sai.msu.su/~megera/postgres/gist/tree/dmoz-full.sql.gz
There are functions
entree_level(entree) and bitree_level(bitree) which returns next level of
the node. To add node:
select entree_next(tid) from dmoz where tid <* '1.2.3.*.0' order by tid
desc limit 1;
but you're free to add node by hand:
test=# create table tree ( node bitree );
CREATE
test=# insert into tree values ('22.9.15.19.12');
INSERT 41728161 1
est=# select * from tree;
node
---------------
22.9.15.19.12
(1 row)
>
> Does anyone have a clue on how to optimize triggers? Can I use another
> language than PL/PGSQL? Would C be crazy when I do lots of SQL's and no
> calculation in the trigger?
>
> Christian
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 3: if posting/reading through Usenet, please send an appropriate
> subscribe-nomail command to majordomo@postgresql.org so that your
> message can get through to the mailing list cleanly
>
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
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, chrris@mail.dk, chriskl@familyhealth.com.au
Subject: Re: Optimizing the implementation of an optimized tree
In-Reply-To: <Pine.GSO.4.44.0205071443490.12738-100000@ra.sai.msu.su>
References: <1020769399.889.10.camel@penelope.dyndns.dk> <Pine.GSO.4.44.0205071443490.12738-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