Forum OpenACS Development: Response to CONNECT BY solution

Collapse
Posted by Nathan Stitt on
The set based method you outline is very good, and I have used it
before, however be aware that inserts can grow to be VERY expensive if
you have more than a few thousand rows in your table.

Miguel Sofer has a much better solution (IMHO) at:
http://www.utdt.edu/~mig/trees.tar.gz His solution is to use base 160
encoded strings in a text field.

I will illustrate with numbers so it's perhaps clearer:
So 1/2/4 in this field would mean that this post's id is 4 and it
refers to post 2, which refers in turn to post 1.

My example probably isn't very clear, but I encourage you to read his
paper to understand it further. The paper isn't complete yet, but
there is enough there to explain the general idea.  I plan on
implementing it soon for a project I'm working on and put an
explanation of the method up on my homepage at: http://www.stitt.org/