simpli Posted May 3, 2009 Share Posted May 3, 2009 Hi, I am in the designing part of creating a client server AJAX application. I will need to represent hierarchical data. I know there are two big schools of thought for representing such data: The adjacency model and the nested set.It's nightmarish to use adjacency with SQL because it's just awkward to code and gets complicated as the number of levels increase. Nested models is however very slow for trees where we will write because a lot of data needs to be moved around upon insertion. I know for a fact that my tree structure will be big and will have to be able to handle inserts gracefully. Does that condemn me to using the Adjacency model? In what I've read out there, there's always mention of a third option that would overcome the shortcomings of either method but I've never seen any sign of it. Anyone has a clue about that third method? Can anyone php libraries for either method? Thanks, JR Quote Link to comment https://forums.phpfreaks.com/topic/156683-solved-adjacency-vs-nested-sets-what-are-the-other-options/ Share on other sites More sharing options...
kickstart Posted May 4, 2009 Share Posted May 4, 2009 Hi Having similar thoughts about a major system change we will have to do soon. If you are doing large amounts of inserts then you can space the number rangers out in the nested sets (ie, multiply the left and right amounts by 100), allowing you to do many inserts without having to individually update the right limits for each insert. Then just remove the spaces afterwards. All the best Keith Quote Link to comment https://forums.phpfreaks.com/topic/156683-solved-adjacency-vs-nested-sets-what-are-the-other-options/#findComment-825610 Share on other sites More sharing options...
Mchl Posted May 4, 2009 Share Posted May 4, 2009 http://www.phpfreaks.com/forums/index.php/topic,210842.0.html See second link (first one too actually) Quote Link to comment https://forums.phpfreaks.com/topic/156683-solved-adjacency-vs-nested-sets-what-are-the-other-options/#findComment-825613 Share on other sites More sharing options...
fenway Posted May 4, 2009 Share Posted May 4, 2009 http://www.phpfreaks.com/forums/index.php/topic,210842.0.html See second link (first one too actually) Second link; slide #68 onwards -- the "closure set" -- is a very practical implementation! Quote Link to comment https://forums.phpfreaks.com/topic/156683-solved-adjacency-vs-nested-sets-what-are-the-other-options/#findComment-826126 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.