SQA recommends the adjacency list pattern [1] over another patterns:

"Despite what many online articles say about modified preorder, the
adjacency list model is probably the most appropriate pattern for the
large majority of hierarchical storage needs, for reasons of
concurrency, reduced complexity, and that modified preorder has little
advantage over an application which can fully load subtrees into the
application space."

But should be in mind that it's slow in reads (althought it's fast in
writes). In change, the nested sets have very efficient reads at the
cost of high maintenance on write/delete operations.

If any is interested in tree structures, there is an excelent
implementation for django ORM, django-treebeard [2], which has
included any benchmarks where you can see the reading differences
between different structures.


[1] http://www.sqlalchemy.org/docs/05/mappers.html#adjacency-list-relationships
[2] http://code.google.com/p/django-treebeard/

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalchemy@googlegroups.com
To unsubscribe from this group, send email to 
sqlalchemy+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to