3 ms·
In addition to expensive insert/update, it is necessary to keep the left and right boundaries across ALL of your entries in perfect order. If the boundaries get
by tempVariable 12y ago
In addition to expensive insert/update, it is necessary to keep the left and right boundaries across ALL of your entries in perfect order. If the boundaries get out of whack, fixing the tree is a nightmare scenario.
I worked on a multi-tenant application with distinct trees present in one table and with one tree per table and so on. Fun fun fun!
- alistairbayley 12y agoI think the nested intervals model, a refinement of nested sets, solves this slow update problem: http://www.rampant-books.com/art_vadim_nested_sets_sql_trees.htm http://www.rampant-books.com/art_vadim_nested_sets_sql_trees... But I've never had to use it, so I am just guessing. Same article, different site: https://communities.bmc.com/docs/DOC-9902 https://communities.bmc.com/docs/DOC-9902 And a paper: http://www.sigmod.org/publications/sigmod-record/0506/p47-article-tropashko.pdf http://www.sigmod.org/publications/sigmod-record/0506/p47-ar... Here's a comparison of the different approaches in a matrix: http://vadimtropashko.wordpress.com/2008/08/09/one-more-nested-intervals-vs-adjacency-list-comparison/ http://vadimtropashko.wordpress.com/2008/08/09/one-more-nest...