Hi Nick,
i just found my model will not work efficiently. The problem is not
not position update, there will be max few tens of nodes in subtree,
so i just have to update them, and even if enough big distance between
positions will be chosen, lets say 10000, i can just do simple checks
between two nodes, (e.g. average value from positions which are
around) and change the position in my node, this will mean few selects
with 2 entries, and one update.
Eg:
B, C, D are sub nodes of A
pB (position of B) = 1 000 000, because it was the first node
created under B
pC = 1 010 000
pD = 1 020 000
nov - reoder to get D, B, C will with some few queries and checks
result with:
pB = 1 000 000 (unchanged)
pC = 1 010 000 (unchanged)
pA = (1 000 000 - 0) / 2 = 500 000 (position updated) [0 is there
because A is the first node]
This will give me a possibility for quick changed in position. Of
course there may be a conflict if i would like to `move` node between
two nodes (Left, Right) and when pR - pL = 0 (difference between two
possitions). This may lead to update of position of multiple nodes,
but probably only one 2 nodes will be updated. But for this, there may
be cron checking difference between positions, and... But i'm not
expecting hundreds of positional moves anyway...
The problem is somewhere else - lies in parents[] property. If there
will be a move on lets say second level, and moved node have 5 000
descendants, parents property of all descendants must be updated, this
will probably not be fast enough, or on other words, it will be very
expensive.
Hmm, i need something better here...
But, anyway thanks for your help!
Peter.
Of course, there might be a conflict when the
On Jul 15, 3:17 pm, "Nick Johnson (Google)" <
nick.john...@google.com>
wrote: