| From: | Oleg Bartunov <oleg(at)sai(dot)msu(dot)su> |
|---|---|
| To: | Christian Brink <cb(at)onsitetech(dot)com> |
| Cc: | pgsql-sql(at)postgresql(dot)org |
| Subject: | Re: Is this the most efficent way to child nodes off a N-ary |
| Date: | 2002-02-14 19:37:29 |
| Message-ID: | Pine.GSO.4.44.0202142236330.9731-100000@ra.sai.msu.su |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-sql |
Christian,
take a look at our contrib/tree module, available from
http://www.sai.msu.su/~megera/postgres/gist/
Oleg
On Thu, 14 Feb 2002, Christian Brink wrote:
> I have created this SQL statment, used to pull the child/leaf nodes off of a
> N-ary node structure in PostgreSQL.
>
> Is my premise all wrong?
>
> Is this efficent as a SQL select?
>
> Should this be done in my code (something I try to avoid for abstraction
> reasons)?
>
> "SELECT DISTINCT t1.node_id FROM node t1 WHERE NOT EXISTS (SELECT
> t1.node_id FROM node t2 WHERE t1.node_id = t2.parent_id);"
>
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
> (send "unregister YourEmailAddressHere" to majordomo(at)postgresql(dot)org)
>
Regards,
Oleg
_____________________________________________________________
Oleg Bartunov, sci.researcher, hostmaster of AstroNet,
Sternberg Astronomical Institute, Moscow University (Russia)
Internet: oleg(at)sai(dot)msu(dot)su, http://www.sai.msu.su/~megera/
phone: +007(095)939-16-83, +007(095)939-23-83
| From | Date | Subject | |
|---|---|---|---|
| Next Message | ron | 2002-02-14 19:55:28 | nexval error duplicate key |
| Previous Message | Oleg Bartunov | 2002-02-14 19:36:02 | pre-alpha release of OpenFTS (perl version) is available for testing |