3 ms·
Closure trees work quite well. I've had some good success with materialized path solutions in Postgres since its support for arrays makes them indexable and ea
by netghost 10y ago
Closure trees work quite well.
I've had some good success with materialized path solutions in Postgres since its support for arrays makes them indexable and easy to query.
I'd suggest picking whichever is easiest to maintain, and works well with the shape and structure of your data. If you use Rails and Postgres I have a few articles including this one that might help illustrate how it can all play together with an ORM: http://www.monkeyandcrow.com/blog/hierarchies_with_rails/ http://www.monkeyandcrow.com/blog/hierarchies_with_rails/