To MPTtree, or not to MPTtree - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: To MPTtree, or not to MPTtree (/showthread.php?tid=17183) |
To MPTtree, or not to MPTtree - El Forum - 03-28-2009 [eluser]TheFuzzy0ne[/eluser] I'm building a forum, and I'm wondering whether or not MPTtree is the way to go. I can't see there being any more than a hundred or so forums/subforums, so do I go with MPTtree, or should I just create a library that grabs all of the forums/subforums from the database, or a serialized array in a file, and have my library handle things that way? I'm interested to know what people think. I've heard a lot about MPTT, but I can't help thinking that it might be overkill with such a small amount of data. Many thanks. To MPTtree, or not to MPTtree - El Forum - 03-28-2009 [eluser]m4rw3r[/eluser] Why not use Adjacency lists (ie. parent_id)? It is quite good, as long as you won't traverse the tree (ie. you never move more than one level per request/query). To MPTtree, or not to MPTtree - El Forum - 03-28-2009 [eluser]TheFuzzy0ne[/eluser] Unless, of course, I get all of the data at once, then I can use a function to iterate through the array, and build any part of the menu. Thanks for your comments. To MPTtree, or not to MPTtree - El Forum - 03-28-2009 [eluser]xwero[/eluser] http://ellislab.com/forums/viewreply/555128/ |