Nested set model: Difference between revisions

Content deleted Content added
Betty (talk | contribs)
Citation bot (talk | contribs)
Add: class, year. | Use this bot. Report bugs. | Suggested by Abductive | Category:Database theory | #UCB_Category 12/54
Line 16:
 
==Technique==
The nested set model is to number the nodes according to a [[tree traversal]], which visits each node twice, assigning numbers in the order of visiting, and at both visits. This leaves two numbers for each node, which are stored as two attributes. Querying becomes inexpensive: hierarchy membership can be tested by comparing these numbers. Updating requires renumbering and is therefore expensive. Refinements that use [[rational number]]s instead of integers can avoid renumbering, and so are faster to update, although much more complicated.<ref>{{cite arXiv |eprint=0806.3115 | first= Daniel|last = Hazel | title = Using rational numbers to key nested sets| year= 2008| class= cs.DB}}</ref>
 
==Example==