Is this the most efficent way to child nodes off a N-ary node database?

From: "Christian Brink" <cb(at)onsitetech(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Subject: Is this the most efficent way to child nodes off a N-ary node database?
Date: 2002-02-14 18:52:47
Message-ID: a4h183$1ud8$1@jupiter.hub.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

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);"

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Eduardo 2002-02-14 19:23:19 Money type and kylix
Previous Message Ross J. Reedstrom 2002-02-14 16:43:41 Re: How long does it take?