![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Hi All, I'm trying to implement a tree structure, hence I'd like the Nested Set model, but I need to be able to record the history of the tree structure *somehow* so that I can access previous versions. I've searched up and down online but all I can find are transactions +rollbacks. As far as I can see... The simplest option would be to add a version number to the model, but then every member of the set would have to be updated each time a change is made - not feasible because of how fast that would make the table would grow, and how slow that would make it to update? I imagine I could log each action and then replay all the log actions in a temporary table when I needed them, but that would get pretty slow after a few updates. The previous Nested Set could be serialised to an blob and stored. That's currently looking like the best option, but only by process of elimination... I've probably missed something obvious that's staring me in the face here! - any suggestions? Thanks for taking the time to read this far, best regards, Ed |
#3
| |||
| |||
|
|
Hi All, I'm trying to implement a tree structure, hence I'd like the Nested Set model, but I need to be able to record the history of the tree structure *somehow* so that I can access previous versions. I've searched up and down online but all I can find are transactions +rollbacks. As far as I can see... The simplest option would be to add a version number to the model, but then every member of the set would have to be updated each time a change is made - not feasible because of how fast that would make the table would grow, and how slow that would make it to update? I imagine I could log each action and then replay all the log actions in a temporary table when I needed them, but that would get pretty slow after a few updates. The previous Nested Set could be serialised to an blob and stored. That's currently looking like the best option, but only by process of elimination... I've probably missed something obvious that's staring me in the face here! - any suggestions? Thanks for taking the time to read this far, best regards, Ed |
#4
| |||
| |||
|
|
On Oct 28, 9:55*am, Ed Lucas <edward.lu... (AT) gmail (DOT) com> wrote: Hi All, I'm trying to implement a tree structure, hence I'd like the Nested Set model, but I need to be able to record the history of the tree structure *somehow* so that I can access previous versions. I've searched up and down online but all I can find are transactions +rollbacks. As far as I can see... The simplest option would be to add a version number to the model, but then every member of the set would have to be updated each time a change is made - not feasible because of how fast that would make the table would grow, and how slow that would make it to update? I imagine I could log each action and then replay all the log actions in a temporary table when I needed them, but that would get pretty slow after a few updates. The previous Nested Set could be serialised to an blob and stored. That's currently looking like the best option, but only by process of elimination... I've probably missed something obvious that's staring me in the face here! - any suggestions? Thanks for taking the time to read this far, best regards, Ed When you make even small change to a tree (e.g. insert a node), you have to recalculate half of the node encodings on average. This feature alone invalidates nested sets approach for temporal hierarchies. Google nested intervals. |
#5
| |||
| |||
|
|
On 30 Oct, 16:04, Tegiri Nenashi <tegirinena... (AT) gmail (DOT) com> wrote: On Oct 28, 9:55*am, Ed Lucas <edward.lu... (AT) gmail (DOT) com> wrote: Hi All, I'm trying to implement a tree structure, hence I'd like the Nested Set model, but I need to be able to record the history of the tree structure *somehow* so that I can access previous versions. I've searched up and down online but all I can find are transactions +rollbacks. As far as I can see... The simplest option would be to add a version number to the model, but then every member of the set would have to be updated each time a change is made - not feasible because of how fast that would make the table would grow, and how slow that would make it to update? I imagine I could log each action and then replay all the log actions in a temporary table when I needed them, but that would get pretty slow after a few updates. The previous Nested Set could be serialised to an blob and stored. That's currently looking like the best option, but only by process of elimination... I've probably missed something obvious that's staring me in the face here! - any suggestions? Thanks for taking the time to read this far, best regards, Ed When you make even small change to a tree (e.g. insert a node), you have to recalculate half of the node encodings on average. This feature alone invalidates nested sets approach for temporal hierarchies. Google nested intervals. Aha! Thank you very much to you and Vladimir! Now I just need to sit in a darkened room with a lot of coffee while I get my head round it all...- Hide quoted text - - Show quoted text - |
#6
| |||
| |||
|
|
On 30 Oct, 16:04, Tegiri Nenashi <tegirinena... (AT) gmail (DOT) com> wrote: On Oct 28, 9:55*am, Ed Lucas <edward.lu... (AT) gmail (DOT) com> wrote: Hi All, I'm trying to implement a tree structure, hence I'd like the Nested Set model, but I need to be able to record the history of the tree structure *somehow* so that I can access previous versions. I've searched up and down online but all I can find are transactions +rollbacks. As far as I can see... The simplest option would be to add a version number to the model, but then every member of the set would have to be updated each time a change is made - not feasible because of how fast that would make the table would grow, and how slow that would make it to update? I imagine I could log each action and then replay all the log actions in a temporary table when I needed them, but that would get pretty slow after a few updates. The previous Nested Set could be serialised to an blob and stored. That's currently looking like the best option, but only by process of elimination... I've probably missed something obvious that's staring me in the face here! - any suggestions? Thanks for taking the time to read this far, best regards, Ed When you make even small change to a tree (e.g. insert a node), you have to recalculate half of the node encodings on average. This feature alone invalidates nested sets approach for temporal hierarchies. Google nested intervals. Aha! Thank you very much to you and Vladimir! Now I just need to sit in a darkened room with a lot of coffee while I get my head round it all...- Hide quoted text - - Show quoted text - Because there are many kinds of hierarchies, I can suggest the most |
#7
| |||
| |||
|
![]() |
| Thread Tools | |
| Display Modes | |
| |