I had a problem like this awhile ago.
Here's my solution:
http://geniegate.com/art/pdf/tree-st...l-database.pdf
It was kind of nice to be able to do this:
Code:
SELECT
*
FROM
directory
WHERE
lookup_directory_ancestor_path(id) LIKE 'Blah/%';
And not clutter the program up with a bunch of tree handling stuff.
I was going to go with flat files at first, but decided I wanted relational after thinking about some of the other aspects (integrity checks).
You can also create database-side indexes, but in practice, I haven't needed them. (I just created an index, then dropped it, to see if it'd actually work.)
Bookmarks