hubert depesz lubaczewski wrote:
On 3/1/07, Kenneth Downs <ken@xxxxxxxxxx> wrote:
Better? I think perhaps different. There is materialized path, which
requires a very problematic unlimited-length column to hold the path,
and there is upper/lower bounds, which again requires client-side
row-by-row processing. Both have the unpleasant problem that changes to
one row may affect many others.
there are also other approaches.
i know that they are not that well known, but there are, and they
allow many things to be done with very simple queries.
i use a solution which basically allows me to query every kind of
tree-structure data without loops or recursion. drawbacks are 2 and
are very limited:
1. it uses some triggers
2. it has some (slight in my opinion) overhead.
I see you've moved the client-side code to the server, which is a Good
Thing in my book.
The overhead would be proportional to the number of rows that have to be
looked at when a new row goes in.
This reminds me of another advantage of the WITH RECURSIVE, which is
that it pushes to overhead to SELECT, with no associated write-time
overheads.
--
Kenneth Downs
Secure Data Software, Inc.
www.secdat.com / www.andromeda-project.org
Office: 631-689-7200 Cell: 631-379-0010
::Think you may have a problem with programming? Ask yourself this
::question: do you worry about how to throw away a garbage can?