3 ms·
Why not use a better non-recursive method for creating your menu tree [eg modified preorder tree traversal], no recursion required, no complicated CTE required,
by smiler 14y ago
Why not use a better non-recursive method for creating your menu tree [eg modified preorder tree traversal], no recursion required, no complicated CTE required, just a simple select?
Although it is slightly more expensive / complicated to update / insert, menu's seem to be the perfect tree for that as the chances of the tree changing that often are relatively slim.
- einhverfr 14y agoThe menu is rendered relatively rarely. Even if we were to go that route, I think the simple solution would be to take what goes into the CTE and materialize it after menu update. But it's not a lot of nodes and not a lot of depth. Why complicate your data storage model if you don't need to?