Hello,
at the time I try to figure out what's the best way
to get a kind of parent/child - hierarchy with unlimited
subchild.
My special attention is situated on really fast SELECT statements.
Actually I'm using nested sets like:
CREATE TABLE Personnel
(emp CHAR(10) PRIMARY KEY,
salary DECIMAL(6,2) NOT NULL,
left INTEGER NOT NULL,
right INTEGER NOT NULL);
so I fetch all the bosses of an employee with this kind of SELECT:
SELECT :myworker, B1.emp, (right - left) AS height
FROM Personnel AS B1, Personnel AS E1
WHERE E1.left BETWEEN B1.left AND B1.right
AND E1.right BETWEEN B1.left AND B1.right
AND E1.emp = :myworker;
but now I wonder if it wouldn't be better to use the
so called "key path method" where you put the whole
top hierarchy info of a node into one column like:
root/parent1/parent23/parent40/... and so on.
Did someone make experience with one of this methods?
thanx
chris
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Christian Fellner
EGGER & LERCH GmbH
Kirchengasse 1a/5
A-1070 Wien
phone: +43-1-5248900-20
email: [EMAIL PROTECTED]
[EMAIL PROTECTED]
web: http:\\www.egger-lerch.at
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/"\
\ / ASCII RIBBON CAMPAIGN
X AGAINST HTML EMAIL
/ \ AND POSTINGS