I\'ve got a sort of tree like thing going on in my MySQL database.
I have a database that has categories, and each category has a subcat. I\'m keeping all the catego
I would like to share my idea with you.
Limitation of Adjacency Model: Follow the Managing Hierarchical Data in MySQL As you already described adjacency model has limitation that you have to know the level before you retrieve path.
Use Nested model: But if you convert the data structure your data structure to Nested set model then you can still use the self join to get the tree.
Converting Hierarchical model to Nested model: Now we need a tree travel algorithm to index the nested model. This can be implemented in mysql function (Sorry the conversion needs some algorithm implementation : A tree traversal algorithm. Not sure which one is best fitted).
Thanks :)