This is an API module to help putting entities in a tree hierarchy. (Actually. DAG. I want to support multiple parents). We encode trees by enumerating each children of a parent, encode them with UTF-8 (I just use it as an algorithm) and then writing them down as an encoding of the materialized path. As UTF-8 as a binary stream sorts the same as the numbers encoded this works well. UTF-8 can encode at most 2**31 so that's the most children each parent can have.
MySQL indexing restricts us of somewhat to a max depth of 255 (or less) but that's not serious.
In PostgreSQL you want to use a c_locale character field ( I think ) and in MySQL, use VARBINARY.
See this presentation for a through explanation.
Downloads
Project Information
- Maintenance status: Seeking co-maintainer(s)
- Development status: Under active development
- Last modified: April 9, 2012