[Dbix-class] DBIx::Class::Tree::Fast

vdg vdg at polygonism.net
Tue Aug 3 16:26:13 GMT 2010


Hello all,

I have implemented a new dbic component to manage trees.

It's an alternative method to DBIx::Class::Tree::AdjacencyList and
DBIx::Class::Tree::NestedSet.

Basically it's the implementation of the general method describe in this
paper :

   http://arxiv.org/pdf/cs.DB/0402051

with this model, you keep the advantage of NestedSet to query descendants
without difficulties querying ancestors.
Plus the encoding is not volatile (no need to recalculate half of the tree
encoding after an insert) and there is
a direct correspondence between the materialized path of a node and its
encoding. The model is described in the paper
are more scalable, but i've yet to make some tests to get an idea how deep
you can build down in a tree.

This implementation don't use at all the primary key of the table (if any)
and don't try to order children.
Ordered tree could be a sub component i guess.

The only trade-off is that i use 7 (!) columns to do the encoding.

github : http://github.com/vdg/DBIx-Class-Tree-Fast


Comments and ideas very welcome off course.

v.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/dbix-class/attachments/20100803/9a5=
647df/attachment-0001.htm


More information about the DBIx-Class mailing list