[eluser]Unknown[/eluser]
[quote author="nardanadam" date="1258495169"]m4rw3r, your solution requires update of 'order' columns of data, when an insert operation is processed.
Do you think it really fits for this situation?[/quote]
Nested sets model implies updating when inserting new records, it is a normal situation.
Say when you want to insert a new item between two existing ones with adjacent
(lft, rgt) ranges (e. g.
(10, 20) and
(21, 30)), you will have to update the range boundaries of the rightmost item
and all items to the right of it.
It's like inserting a new node into an XML file: when you do it, all subsequent tags (even those that do not define direct ancestors, siblings or descendants of the node being inserted) are being shifted several lines down.
This can be mitigated to some extent by reserving some extra space when inserting new records (making
lft and
rgt more sparse).