CHAPTER 5 Frequent Insertion Trees
THE PROBLEM IN a nested sets tree with frequent insertions is that the left and right (lft, rgt) pairs have to be adjusted so often that locking the table, changing the rows, and unlocking the table again becomes a major overhead. The nested sets model does not require that the union of the rgt and lft numbers be an unbroken sequence to show nesting. All you need are the condition that (lft < rgt), uniqueness of lft and rgt numbers, and that subordination is represented by containment of one (lft, rgt) pair within the ranges of the other (lft, rgt) pairs. This means that we can put gaps into the initial design of the table and fill them without having to reorganize the table each time. The size of the gaps ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access