how arrange tree stored controlling nested set model?


when i ascribe nested set denote i meant described



i need build new component storing "categories" (i can't cruise improved it) user tangible hierarchy. given nested set denote optimized reads instead writes, i solid that. unfortunately during investigate contrast nested sets, i ran problem i arrangement hierarchical tree sorted nodes. instance i have hierarchy:



root
finances
budgeting
fy08
projects
research
fabrication
release
trash


i wish sorted displays as:



root
finances
budgeting
fy08
projects
fabrication
release
research
trash


notice phony appears before research.



anyway, after enlarged hunt i saw answer such "store tree multi-dimensional array arrange it" "resort tree serialized behind your nested set model" (i'm paraphrazing...). presumably way, initial fortitude terrible rubbish propel cpu, both unequivocally calculable resources... second fortitude only looks lot upsetting code.



regardless, i means figure out (using nested set model):




  1. start new tree sql

  2. insert node child another node tree

  3. insert node after family node tree

  4. pull whole tree hierarchy structure sql

  5. pull subtree specific node (including root) hierarchy but abyss limit

  6. find progenitor any node tree



so i figured #5 #6 used classification i wanted, also used transform tree sorted method well.



however, i've looked during things i've scholastic i #3, #5, #6 used together perform sorted inserts. i sorted inserts always sorted. however, i ever change arrange criteria i wish opposite arrange method i'm behind retard one.



could only discount nested set model? does the stop query classification output?



Comments

Popular posts from this blog

list macos calm editors formula editors

how i practical urls indicate .aspx pages asp.net deployed an iis? (preferably but iis)

jaxb - xjc - reworking generated typesafe enum category members